
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Ccm · 这是程序员吗</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="xishengcai">
        
        
    
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-disqus/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-prism/prism-base16-ateliersulphurpool.light.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-advanced-emoji/emoji-website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-katex/katex.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-sectionx/sectionx.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-local-video/video-js.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-terminal/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-versions-select/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-theme-comscore/test.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    


    

        
    
    
    
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="client-go.html" />
    
    
    <link rel="prev" href="admission access.html" />
    

    
    <link rel="stylesheet" href="../../gitbook/gitbook-plugin-chart/c3/c3.min.css">
    <script src="../../gitbook/gitbook-plugin-chart/c3/d3.min.js"></script>
    <script src="../../gitbook/gitbook-plugin-chart/c3/c3.min.js"></script>
    

    <script src="../../gitbook/gitbook-plugin-graph/d3.min.js"></script>
    <script src="../../gitbook/gitbook-plugin-graph/function-plot.js"></script>    

    
        <link rel="shortcut icon" href='../../favicon.ico' type="image/x-icon">
    
    
        <link rel="bookmark" href='../../favicon.ico' type="image/x-icon">
    
    
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"repo":"xishengcai/xisheng.blog","types":["star"],"size":"small"};
    </script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://xisheng.vip" target="_blank" class="custom-link">Home</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        <li class="header">Blog</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                        <b>1.1.</b>
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../algorithm/">
            
                <a href="../algorithm/">
            
                    
                        <b>1.2.</b>
                    
                    Algorithm
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../algorithm/heap.html">
            
                <a href="../algorithm/heap.html">
            
                    
                        <b>1.2.1.</b>
                    
                    Heap
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../algorithm/readme.html">
            
                <a href="../algorithm/readme.html">
            
                    
                        <b>1.2.2.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../angular/">
            
                <a href="../angular/">
            
                    
                        <b>1.3.</b>
                    
                    Angular
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../angular/1-start.html">
            
                <a href="../angular/1-start.html">
            
                    
                        <b>1.3.1.</b>
                    
                    Start
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../angular/2-component.html">
            
                <a href="../angular/2-component.html">
            
                    
                        <b>1.3.2.</b>
                    
                    Component
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../angular/3-form.html">
            
                <a href="../angular/3-form.html">
            
                    
                        <b>1.3.3.</b>
                    
                    Form
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../angular/readme.html">
            
                <a href="../angular/readme.html">
            
                    
                        <b>1.3.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../database/">
            
                <a href="../database/">
            
                    
                        <b>1.4.</b>
                    
                    Database
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../database/mongodb.html">
            
                <a href="../database/mongodb.html">
            
                    
                        <b>1.4.1.</b>
                    
                    Mongodb
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../database/readme.html">
            
                <a href="../database/readme.html">
            
                    
                        <b>1.4.2.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../docker/">
            
                <a href="../docker/">
            
                    
                        <b>1.5.</b>
                    
                    Docker
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../docker/CentOS.html">
            
                <a href="../docker/CentOS.html">
            
                    
                        <b>1.5.1.</b>
                    
                    CentOS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../docker/install.html">
            
                <a href="../docker/install.html">
            
                    
                        <b>1.5.2.</b>
                    
                    Install
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../docker/readme.html">
            
                <a href="../docker/readme.html">
            
                    
                        <b>1.5.3.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../docker/官方shell.html">
            
                <a href="../docker/官方shell.html">
            
                    
                        <b>1.5.4.</b>
                    
                    官方Shell
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../golang/">
            
                <a href="../golang/">
            
                    
                        <b>1.6.</b>
                    
                    Golang
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../golang/aop.html">
            
                <a href="../golang/aop.html">
            
                    
                        <b>1.6.1.</b>
                    
                    Aop
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../golang/base/">
            
                <a href="../golang/base/">
            
                    
                        <b>1.6.2.</b>
                    
                    Base
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.2.1" data-path="../golang/base/copy.html">
            
                <a href="../golang/base/copy.html">
            
                    
                        <b>1.6.2.1.</b>
                    
                    Copy
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.2" data-path="../golang/base/new_and_make.html">
            
                <a href="../golang/base/new_and_make.html">
            
                    
                        <b>1.6.2.2.</b>
                    
                    New And Make
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.3" data-path="../golang/base/readme.html">
            
                <a href="../golang/base/readme.html">
            
                    
                        <b>1.6.2.3.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.4" data-path="../golang/base/reflect.html">
            
                <a href="../golang/base/reflect.html">
            
                    
                        <b>1.6.2.4.</b>
                    
                    Reflect
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.5" data-path="../golang/base/string.html">
            
                <a href="../golang/base/string.html">
            
                    
                        <b>1.6.2.5.</b>
                    
                    String
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.6" data-path="../golang/base/tag.html">
            
                <a href="../golang/base/tag.html">
            
                    
                        <b>1.6.2.6.</b>
                    
                    Tag
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../golang/clouser.html">
            
                <a href="../golang/clouser.html">
            
                    
                        <b>1.6.3.</b>
                    
                    Clouser
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../golang/err 优雅处理.html">
            
                <a href="../golang/err 优雅处理.html">
            
                    
                        <b>1.6.4.</b>
                    
                    Err 优雅处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../golang/go module 2.html">
            
                <a href="../golang/go module 2.html">
            
                    
                        <b>1.6.5.</b>
                    
                    Go Module 2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../golang/go_mod.html">
            
                <a href="../golang/go_mod.html">
            
                    
                        <b>1.6.6.</b>
                    
                    Go Mod
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../golang/gocraftwork.html">
            
                <a href="../golang/gocraftwork.html">
            
                    
                        <b>1.6.7.</b>
                    
                    Gocraftwork
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../golang/oauth.html">
            
                <a href="../golang/oauth.html">
            
                    
                        <b>1.6.8.</b>
                    
                    Oauth
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="../golang/readme.html">
            
                <a href="../golang/readme.html">
            
                    
                        <b>1.6.9.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10" data-path="../golang/swagger.html">
            
                <a href="../golang/swagger.html">
            
                    
                        <b>1.6.10.</b>
                    
                    Swagger
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11" data-path="../golang/tls.html">
            
                <a href="../golang/tls.html">
            
                    
                        <b>1.6.11.</b>
                    
                    Tls
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.12" >
            
                <span>
            
                    
                        <b>1.6.12.</b>
                    
                    代码走读
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.12.1" data-path="../golang/代码走读/2020.5.26.html">
            
                <a href="../golang/代码走读/2020.5.26.html">
            
                    
                        <b>1.6.12.1.</b>
                    
                    2020.5.26
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.13" data-path="../golang/任务队列/">
            
                <a href="../golang/任务队列/">
            
                    
                        <b>1.6.13.</b>
                    
                    任务队列
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.13.1" data-path="../golang/任务队列/gocraft-worker.html">
            
                <a href="../golang/任务队列/gocraft-worker.html">
            
                    
                        <b>1.6.13.1.</b>
                    
                    Gocraft Worker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.13.2" data-path="../golang/任务队列/readme.html">
            
                <a href="../golang/任务队列/readme.html">
            
                    
                        <b>1.6.13.2.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.14" data-path="../golang/参数校验.html">
            
                <a href="../golang/参数校验.html">
            
                    
                        <b>1.6.14.</b>
                    
                    参数校验
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../istio/">
            
                <a href="../istio/">
            
                    
                        <b>1.7.</b>
                    
                    Istio
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../istio/readme.html">
            
                <a href="../istio/readme.html">
            
                    
                        <b>1.7.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../istio/virtualservice.html">
            
                <a href="../istio/virtualservice.html">
            
                    
                        <b>1.7.2.</b>
                    
                    Virtualservice
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" >
            
                <span>
            
                    
                        <b>1.8.</b>
                    
                    Java
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../java/jvm.html">
            
                <a href="../java/jvm.html">
            
                    
                        <b>1.8.1.</b>
                    
                    Jvm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../java/typescript.html">
            
                <a href="../java/typescript.html">
            
                    
                        <b>1.8.2.</b>
                    
                    Typescript
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="./">
            
                <a href="./">
            
                    
                        <b>1.9.</b>
                    
                    Kubernetes
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="APIService.html">
            
                <a href="APIService.html">
            
                    
                        <b>1.9.1.</b>
                    
                    APIService
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="CAK.html">
            
                <a href="CAK.html">
            
                    
                        <b>1.9.2.</b>
                    
                    CAK
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="Deployment 的实现原理.html">
            
                <a href="Deployment 的实现原理.html">
            
                    
                        <b>1.9.3.</b>
                    
                    Deployment 的实现原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="K8s源码/">
            
                <a href="K8s源码/">
            
                    
                        <b>1.9.4.</b>
                    
                    K8s源码
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.4.1" data-path="K8s源码/calico 源码分析.html">
            
                <a href="K8s源码/calico 源码分析.html">
            
                    
                        <b>1.9.4.1.</b>
                    
                    Calico 源码分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.2" data-path="K8s源码/garbage collector controller 源码分析.html">
            
                <a href="K8s源码/garbage collector controller 源码分析.html">
            
                    
                        <b>1.9.4.2.</b>
                    
                    Garbage Collector Controller 源码分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.3" data-path="K8s源码/job.html">
            
                <a href="K8s源码/job.html">
            
                    
                        <b>1.9.4.3.</b>
                    
                    Job
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.4" data-path="K8s源码/kube-proxy-iptables.html">
            
                <a href="K8s源码/kube-proxy-iptables.html">
            
                    
                        <b>1.9.4.4.</b>
                    
                    Kube Proxy Iptables
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.5" data-path="K8s源码/kube-proxy-ipvs.html">
            
                <a href="K8s源码/kube-proxy-ipvs.html">
            
                    
                        <b>1.9.4.5.</b>
                    
                    Kube Proxy Ipvs
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.6" data-path="K8s源码/kube-proxy.html">
            
                <a href="K8s源码/kube-proxy.html">
            
                    
                        <b>1.9.4.6.</b>
                    
                    Kube Proxy
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.7" data-path="K8s源码/kubectl-exec.html">
            
                <a href="K8s源码/kubectl-exec.html">
            
                    
                        <b>1.9.4.7.</b>
                    
                    Kubectl Exec
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.8" data-path="K8s源码/kubectl源码阅读1.html">
            
                <a href="K8s源码/kubectl源码阅读1.html">
            
                    
                        <b>1.9.4.8.</b>
                    
                    Kubectl源码阅读1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.9" data-path="K8s源码/kubectl源码阅读2.html">
            
                <a href="K8s源码/kubectl源码阅读2.html">
            
                    
                        <b>1.9.4.9.</b>
                    
                    Kubectl源码阅读2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.10" data-path="K8s源码/readme.html">
            
                <a href="K8s源码/readme.html">
            
                    
                        <b>1.9.4.10.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.11" data-path="K8s源码/schedule.html">
            
                <a href="K8s源码/schedule.html">
            
                    
                        <b>1.9.4.11.</b>
                    
                    Schedule
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.12" data-path="K8s源码/scheme.html">
            
                <a href="K8s源码/scheme.html">
            
                    
                        <b>1.9.4.12.</b>
                    
                    Scheme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.13" data-path="K8s源码/调度队列.html">
            
                <a href="K8s源码/调度队列.html">
            
                    
                        <b>1.9.4.13.</b>
                    
                    调度队列
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.5" data-path="Karmada.html">
            
                <a href="Karmada.html">
            
                    
                        <b>1.9.5.</b>
                    
                    Karmada
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.6" data-path="Pixie.html">
            
                <a href="Pixie.html">
            
                    
                        <b>1.9.6.</b>
                    
                    Pixie
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.7" data-path="admission access.html">
            
                <a href="admission access.html">
            
                    
                        <b>1.9.7.</b>
                    
                    Admission Access
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.9.8" data-path="ccm.html">
            
                <a href="ccm.html">
            
                    
                        <b>1.9.8.</b>
                    
                    Ccm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.9" data-path="client-go.html">
            
                <a href="client-go.html">
            
                    
                        <b>1.9.9.</b>
                    
                    Client Go
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.10" data-path="command.html">
            
                <a href="command.html">
            
                    
                        <b>1.9.10.</b>
                    
                    Command
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.11" data-path="controller.html">
            
                <a href="controller.html">
            
                    
                        <b>1.9.11.</b>
                    
                    Controller
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.12" data-path="copy docker config.html">
            
                <a href="copy docker config.html">
            
                    
                        <b>1.9.12.</b>
                    
                    Copy Docker Config
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.13" data-path="etcd-operation.html">
            
                <a href="etcd-operation.html">
            
                    
                        <b>1.9.13.</b>
                    
                    Etcd Operation
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.14" data-path="gc.html">
            
                <a href="gc.html">
            
                    
                        <b>1.9.14.</b>
                    
                    Gc
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.15" data-path="helm chart.html">
            
                <a href="helm chart.html">
            
                    
                        <b>1.9.15.</b>
                    
                    Helm Chart
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.16" data-path="helm.html">
            
                <a href="helm.html">
            
                    
                        <b>1.9.16.</b>
                    
                    Helm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17" >
            
                <span>
            
                    
                        <b>1.9.17.</b>
                    
                    Helm
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.17.1" data-path="helm/charts.html">
            
                <a href="helm/charts.html">
            
                    
                        <b>1.9.17.1.</b>
                    
                    Charts
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17.2" data-path="helm/helm 钩子函数.html">
            
                <a href="helm/helm 钩子函数.html">
            
                    
                        <b>1.9.17.2.</b>
                    
                    Helm 钩子函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17.3" data-path="helm/helm-operator.html">
            
                <a href="helm/helm-operator.html">
            
                    
                        <b>1.9.17.3.</b>
                    
                    Helm Operator
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17.4" data-path="helm/文档查询.html">
            
                <a href="helm/文档查询.html">
            
                    
                        <b>1.9.17.4.</b>
                    
                    文档查询
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17.5" data-path="helm/语法.html">
            
                <a href="helm/语法.html">
            
                    
                        <b>1.9.17.5.</b>
                    
                    语法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.18" data-path="install.html">
            
                <a href="install.html">
            
                    
                        <b>1.9.18.</b>
                    
                    Install
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.19" data-path="istio-inject.html">
            
                <a href="istio-inject.html">
            
                    
                        <b>1.9.19.</b>
                    
                    Istio Inject
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.20" >
            
                <span>
            
                    
                        <b>1.9.20.</b>
                    
                    KubeEdge
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.21" data-path="kuber-apiserver-flag.html">
            
                <a href="kuber-apiserver-flag.html">
            
                    
                        <b>1.9.21.</b>
                    
                    Kuber Apiserver Flag
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.22" data-path="kubernetes-client.html">
            
                <a href="kubernetes-client.html">
            
                    
                        <b>1.9.22.</b>
                    
                    Kubernetes Client
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.23" data-path="kubernetes灾备.html">
            
                <a href="kubernetes灾备.html">
            
                    
                        <b>1.9.23.</b>
                    
                    Kubernetes灾备
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.24" data-path="kubesphere/">
            
                <a href="kubesphere/">
            
                    
                        <b>1.9.24.</b>
                    
                    Kubesphere
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.24.1" data-path="kubesphere/helm.html">
            
                <a href="kubesphere/helm.html">
            
                    
                        <b>1.9.24.1.</b>
                    
                    Helm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.24.2" data-path="kubesphere/readme.html">
            
                <a href="kubesphere/readme.html">
            
                    
                        <b>1.9.24.2.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.25" data-path="kubevela/">
            
                <a href="kubevela/">
            
                    
                        <b>1.9.25.</b>
                    
                    Kubevela
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.25.1" data-path="kubevela/KubeVela 功能.html">
            
                <a href="kubevela/KubeVela 功能.html">
            
                    
                        <b>1.9.25.1.</b>
                    
                    KubeVela 功能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.2" data-path="kubevela/cue.html">
            
                <a href="kubevela/cue.html">
            
                    
                        <b>1.9.25.2.</b>
                    
                    Cue
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.3" data-path="kubevela/oam.html">
            
                <a href="kubevela/oam.html">
            
                    
                        <b>1.9.25.3.</b>
                    
                    Oam
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.4" data-path="kubevela/readme.html">
            
                <a href="kubevela/readme.html">
            
                    
                        <b>1.9.25.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.5" data-path="kubevela/rollout design.html">
            
                <a href="kubevela/rollout design.html">
            
                    
                        <b>1.9.25.5.</b>
                    
                    Rollout Design
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.6" data-path="kubevela/vela run.html">
            
                <a href="kubevela/vela run.html">
            
                    
                        <b>1.9.25.6.</b>
                    
                    Vela Run
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.7" data-path="kubevela/vela up.html">
            
                <a href="kubevela/vela up.html">
            
                    
                        <b>1.9.25.7.</b>
                    
                    Vela Up
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.8" data-path="kubevela/vela-cluster.html">
            
                <a href="kubevela/vela-cluster.html">
            
                    
                        <b>1.9.25.8.</b>
                    
                    Vela Cluster
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.9" data-path="kubevela/vela-helm.html">
            
                <a href="kubevela/vela-helm.html">
            
                    
                        <b>1.9.25.9.</b>
                    
                    Vela Helm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.10" data-path="kubevela/vela-pk-oam.html">
            
                <a href="kubevela/vela-pk-oam.html">
            
                    
                        <b>1.9.25.10.</b>
                    
                    Vela Pk Oam
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.26" data-path="mk-cert.html">
            
                <a href="mk-cert.html">
            
                    
                        <b>1.9.26.</b>
                    
                    Mk Cert
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.27" data-path="open_swagger-ui.html">
            
                <a href="open_swagger-ui.html">
            
                    
                        <b>1.9.27.</b>
                    
                    Open Swagger Ui
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.28" data-path="readme.html">
            
                <a href="readme.html">
            
                    
                        <b>1.9.28.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29" data-path="task/">
            
                <a href="task/">
            
                    
                        <b>1.9.29.</b>
                    
                    Task
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.29.1" data-path="task/HPA.html">
            
                <a href="task/HPA.html">
            
                    
                        <b>1.9.29.1.</b>
                    
                    HPA
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.2" data-path="task/kubectl patch.html">
            
                <a href="task/kubectl patch.html">
            
                    
                        <b>1.9.29.2.</b>
                    
                    Kubectl Patch
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.3" data-path="task/pod 信息注入.html">
            
                <a href="task/pod 信息注入.html">
            
                    
                        <b>1.9.29.3.</b>
                    
                    Pod 信息注入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.4" data-path="task/pod 垂直扩缩容.html">
            
                <a href="task/pod 垂直扩缩容.html">
            
                    
                        <b>1.9.29.4.</b>
                    
                    Pod 垂直扩缩容
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.5" data-path="task/readme.html">
            
                <a href="task/readme.html">
            
                    
                        <b>1.9.29.5.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.6" data-path="task/server-side-apply.html">
            
                <a href="task/server-side-apply.html">
            
                    
                        <b>1.9.29.6.</b>
                    
                    Server Side Apply
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.7" data-path="task/准入控制.html">
            
                <a href="task/准入控制.html">
            
                    
                        <b>1.9.29.7.</b>
                    
                    准入控制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.8" data-path="task/聚合api.html">
            
                <a href="task/聚合api.html">
            
                    
                        <b>1.9.29.8.</b>
                    
                    聚合Api
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.9" data-path="task/资源预留配置.html">
            
                <a href="task/资源预留配置.html">
            
                    
                        <b>1.9.29.9.</b>
                    
                    资源预留配置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.30" data-path="webhook.html">
            
                <a href="webhook.html">
            
                    
                        <b>1.9.30.</b>
                    
                    Webhook
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.31" data-path="一致性认证.html">
            
                <a href="一致性认证.html">
            
                    
                        <b>1.9.31.</b>
                    
                    一致性认证
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.32" data-path="专利名词.html">
            
                <a href="专利名词.html">
            
                    
                        <b>1.9.32.</b>
                    
                    专利名词
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.33" data-path="删除namespace.html">
            
                <a href="删除namespace.html">
            
                    
                        <b>1.9.33.</b>
                    
                    删除Namespace
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.34" data-path="简化多集群.html">
            
                <a href="简化多集群.html">
            
                    
                        <b>1.9.34.</b>
                    
                    简化多集群
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.35" data-path="网络插件/">
            
                <a href="网络插件/">
            
                    
                        <b>1.9.35.</b>
                    
                    网络插件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.35.1" data-path="网络插件/calico.html">
            
                <a href="网络插件/calico.html">
            
                    
                        <b>1.9.35.1.</b>
                    
                    Calico
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.35.2" data-path="网络插件/cilium.html">
            
                <a href="网络插件/cilium.html">
            
                    
                        <b>1.9.35.2.</b>
                    
                    Cilium
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.35.3" data-path="网络插件/ebpf.html">
            
                <a href="网络插件/ebpf.html">
            
                    
                        <b>1.9.35.3.</b>
                    
                    Ebpf
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.35.4" data-path="网络插件/readme.html">
            
                <a href="网络插件/readme.html">
            
                    
                        <b>1.9.35.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.36" data-path="镜像/">
            
                <a href="镜像/">
            
                    
                        <b>1.9.36.</b>
                    
                    镜像
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.36.1" data-path="镜像/Containerd Stargz Snapshotter.html">
            
                <a href="镜像/Containerd Stargz Snapshotter.html">
            
                    
                        <b>1.9.36.1.</b>
                    
                    Containerd Stargz Snapshotter
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.2" data-path="镜像/OCI.html">
            
                <a href="镜像/OCI.html">
            
                    
                        <b>1.9.36.2.</b>
                    
                    OCI
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.3" data-path="镜像/harbor/">
            
                <a href="镜像/harbor/">
            
                    
                        <b>1.9.36.3.</b>
                    
                    Harbor
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.36.3.1" data-path="镜像/harbor/readme.html">
            
                <a href="镜像/harbor/readme.html">
            
                    
                        <b>1.9.36.3.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.36.4" data-path="镜像/readme.html">
            
                <a href="镜像/readme.html">
            
                    
                        <b>1.9.36.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.5" data-path="镜像/自动构建镜像.html">
            
                <a href="镜像/自动构建镜像.html">
            
                    
                        <b>1.9.36.5.</b>
                    
                    自动构建镜像
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.6" data-path="镜像/镜像加速方案.html">
            
                <a href="镜像/镜像加速方案.html">
            
                    
                        <b>1.9.36.6.</b>
                    
                    镜像加速方案
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.7" data-path="镜像/镜像延迟加载技术解析.html">
            
                <a href="镜像/镜像延迟加载技术解析.html">
            
                    
                        <b>1.9.36.7.</b>
                    
                    镜像延迟加载技术解析
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../math/">
            
                <a href="../math/">
            
                    
                        <b>1.10.</b>
                    
                    Math
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../math/readme.html">
            
                <a href="../math/readme.html">
            
                    
                        <b>1.10.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../math/泊松分布.html">
            
                <a href="../math/泊松分布.html">
            
                    
                        <b>1.10.2.</b>
                    
                    泊松分布
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../效率/">
            
                <a href="../效率/">
            
                    
                        <b>1.11.</b>
                    
                    效率
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../效率/cat.html">
            
                <a href="../效率/cat.html">
            
                    
                        <b>1.11.1.</b>
                    
                    Cat
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../效率/docker volume clean.html">
            
                <a href="../效率/docker volume clean.html">
            
                    
                        <b>1.11.2.</b>
                    
                    Docker Volume Clean
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../效率/git book.html">
            
                <a href="../效率/git book.html">
            
                    
                        <b>1.11.3.</b>
                    
                    Git Book
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.4" data-path="../效率/git.html">
            
                <a href="../效率/git.html">
            
                    
                        <b>1.11.4.</b>
                    
                    Git
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.5" data-path="../效率/linux command.html">
            
                <a href="../效率/linux command.html">
            
                    
                        <b>1.11.5.</b>
                    
                    Linux Command
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.6" data-path="../效率/linux 内核.html">
            
                <a href="../效率/linux 内核.html">
            
                    
                        <b>1.11.6.</b>
                    
                    Linux 内核
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.7" data-path="../效率/macos path.html">
            
                <a href="../效率/macos path.html">
            
                    
                        <b>1.11.7.</b>
                    
                    Macos Path
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.8" data-path="../效率/nfs.html">
            
                <a href="../效率/nfs.html">
            
                    
                        <b>1.11.8.</b>
                    
                    Nfs
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.9" data-path="../效率/nginx.html">
            
                <a href="../效率/nginx.html">
            
                    
                        <b>1.11.9.</b>
                    
                    Nginx
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.10" data-path="../效率/nginx2.html">
            
                <a href="../效率/nginx2.html">
            
                    
                        <b>1.11.10.</b>
                    
                    Nginx2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.11" data-path="../效率/oauth2.html">
            
                <a href="../效率/oauth2.html">
            
                    
                        <b>1.11.11.</b>
                    
                    Oauth2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.12" data-path="../效率/ovftool.html">
            
                <a href="../效率/ovftool.html">
            
                    
                        <b>1.11.12.</b>
                    
                    Ovftool
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.13" data-path="../效率/readme.html">
            
                <a href="../效率/readme.html">
            
                    
                        <b>1.11.13.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.14" data-path="../效率/sed.html">
            
                <a href="../效率/sed.html">
            
                    
                        <b>1.11.14.</b>
                    
                    Sed
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.15" data-path="../效率/shell_judge.html">
            
                <a href="../效率/shell_judge.html">
            
                    
                        <b>1.11.15.</b>
                    
                    Shell Judge
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.16" data-path="../效率/sshpass.html">
            
                <a href="../效率/sshpass.html">
            
                    
                        <b>1.11.16.</b>
                    
                    Sshpass
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.17" data-path="../效率/telepresence.html">
            
                <a href="../效率/telepresence.html">
            
                    
                        <b>1.11.17.</b>
                    
                    Telepresence
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.18" data-path="../效率/typora.html">
            
                <a href="../效率/typora.html">
            
                    
                        <b>1.11.18.</b>
                    
                    Typora
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.19" data-path="../效率/url encode.html">
            
                <a href="../效率/url encode.html">
            
                    
                        <b>1.11.19.</b>
                    
                    Url Encode
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.20" data-path="../效率/vim.html">
            
                <a href="../效率/vim.html">
            
                    
                        <b>1.11.20.</b>
                    
                    Vim
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.21" data-path="../效率/yum.html">
            
                <a href="../效率/yum.html">
            
                    
                        <b>1.11.21.</b>
                    
                    Yum
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.22" data-path="../效率/内网穿透.html">
            
                <a href="../效率/内网穿透.html">
            
                    
                        <b>1.11.22.</b>
                    
                    内网穿透
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.23" data-path="../效率/科学上网.html">
            
                <a href="../效率/科学上网.html">
            
                    
                        <b>1.11.23.</b>
                    
                    科学上网
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.24" data-path="../效率/证书制作.html">
            
                <a href="../效率/证书制作.html">
            
                    
                        <b>1.11.24.</b>
                    
                    证书制作
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" >
            
                <span>
            
                    
                        <b>1.12.</b>
                    
                    杂谈
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="../杂谈/论好文章和烂文章.html">
            
                <a href="../杂谈/论好文章和烂文章.html">
            
                    
                        <b>1.12.1.</b>
                    
                    论好文章和烂文章
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../测试/">
            
                <a href="../测试/">
            
                    
                        <b>1.13.</b>
                    
                    测试
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="../测试/ginkgo/">
            
                <a href="../测试/ginkgo/">
            
                    
                        <b>1.13.1.</b>
                    
                    Ginkgo
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1.1" data-path="../测试/ginkgo/ginkgo.html">
            
                <a href="../测试/ginkgo/ginkgo.html">
            
                    
                        <b>1.13.1.1.</b>
                    
                    Ginkgo
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.1.2" data-path="../测试/ginkgo/ginkgo_cmd.html">
            
                <a href="../测试/ginkgo/ginkgo_cmd.html">
            
                    
                        <b>1.13.1.2.</b>
                    
                    Ginkgo Cmd
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.1.3" data-path="../测试/ginkgo/readme.html">
            
                <a href="../测试/ginkgo/readme.html">
            
                    
                        <b>1.13.1.3.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13.2" data-path="../测试/golang-test.html">
            
                <a href="../测试/golang-test.html">
            
                    
                        <b>1.13.2.</b>
                    
                    Golang Test
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.3" data-path="../测试/http测试.html">
            
                <a href="../测试/http测试.html">
            
                    
                        <b>1.13.3.</b>
                    
                    Http测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.4" data-path="../测试/readme.html">
            
                <a href="../测试/readme.html">
            
                    
                        <b>1.13.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.5" data-path="../测试/其他功能.html">
            
                <a href="../测试/其他功能.html">
            
                    
                        <b>1.13.5.</b>
                    
                    其他功能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.6" data-path="../测试/单元测试.html">
            
                <a href="../测试/单元测试.html">
            
                    
                        <b>1.13.6.</b>
                    
                    单元测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.7" data-path="../测试/单元测试2.html">
            
                <a href="../测试/单元测试2.html">
            
                    
                        <b>1.13.7.</b>
                    
                    单元测试2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.8" data-path="../测试/基准测试.html">
            
                <a href="../测试/基准测试.html">
            
                    
                        <b>1.13.8.</b>
                    
                    基准测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.9" data-path="../测试/子测试与子基准测试.html">
            
                <a href="../测试/子测试与子基准测试.html">
            
                    
                        <b>1.13.9.</b>
                    
                    子测试与子基准测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.10" data-path="../测试/并行测试.html">
            
                <a href="../测试/并行测试.html">
            
                    
                        <b>1.13.10.</b>
                    
                    并行测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.11" data-path="../测试/质量检查/">
            
                <a href="../测试/质量检查/">
            
                    
                        <b>1.13.11.</b>
                    
                    质量检查
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.11.1" data-path="../测试/质量检查/Sonar.html">
            
                <a href="../测试/质量检查/Sonar.html">
            
                    
                        <b>1.13.11.1.</b>
                    
                    Sonar
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.11.2" data-path="../测试/质量检查/go_lint.html">
            
                <a href="../测试/质量检查/go_lint.html">
            
                    
                        <b>1.13.11.2.</b>
                    
                    Go Lint
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.11.3" data-path="../测试/质量检查/readme.html">
            
                <a href="../测试/质量检查/readme.html">
            
                    
                        <b>1.13.11.3.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../规范/">
            
                <a href="../规范/">
            
                    
                        <b>1.14.</b>
                    
                    规范
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.14.1" data-path="../规范/CodeReviewComments.html">
            
                <a href="../规范/CodeReviewComments.html">
            
                    
                        <b>1.14.1.</b>
                    
                    CodeReviewComments
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.2" data-path="../规范/git规范.html">
            
                <a href="../规范/git规范.html">
            
                    
                        <b>1.14.2.</b>
                    
                    Git规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.3" data-path="../规范/golang 代码规范.html">
            
                <a href="../规范/golang 代码规范.html">
            
                    
                        <b>1.14.3.</b>
                    
                    Golang 代码规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.4" data-path="../规范/readme.html">
            
                <a href="../规范/readme.html">
            
                    
                        <b>1.14.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.5" data-path="../规范/代码走读.html">
            
                <a href="../规范/代码走读.html">
            
                    
                        <b>1.14.5.</b>
                    
                    代码走读
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../设计模式/">
            
                <a href="../设计模式/">
            
                    
                        <b>1.15.</b>
                    
                    设计模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.1" data-path="../设计模式/readme.html">
            
                <a href="../设计模式/readme.html">
            
                    
                        <b>1.15.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2" data-path="../设计模式/创建模型/">
            
                <a href="../设计模式/创建模型/">
            
                    
                        <b>1.15.2.</b>
                    
                    创建模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.2.1" data-path="../设计模式/创建模型/readme.html">
            
                <a href="../设计模式/创建模型/readme.html">
            
                    
                        <b>1.15.2.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.2" data-path="../设计模式/创建模型/创建者模型.html">
            
                <a href="../设计模式/创建模型/创建者模型.html">
            
                    
                        <b>1.15.2.2.</b>
                    
                    创建者模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.3" data-path="../设计模式/创建模型/单例模式.html">
            
                <a href="../设计模式/创建模型/单例模式.html">
            
                    
                        <b>1.15.2.3.</b>
                    
                    单例模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.4" data-path="../设计模式/创建模型/原型模式.html">
            
                <a href="../设计模式/创建模型/原型模式.html">
            
                    
                        <b>1.15.2.4.</b>
                    
                    原型模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.5" data-path="../设计模式/创建模型/工厂方法.html">
            
                <a href="../设计模式/创建模型/工厂方法.html">
            
                    
                        <b>1.15.2.5.</b>
                    
                    工厂方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.6" data-path="../设计模式/创建模型/抽象工厂.html">
            
                <a href="../设计模式/创建模型/抽象工厂.html">
            
                    
                        <b>1.15.2.6.</b>
                    
                    抽象工厂
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.7" data-path="../设计模式/创建模型/简单工厂.html">
            
                <a href="../设计模式/创建模型/简单工厂.html">
            
                    
                        <b>1.15.2.7.</b>
                    
                    简单工厂
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15.3" data-path="../设计模式/结构型模型/">
            
                <a href="../设计模式/结构型模型/">
            
                    
                        <b>1.15.3.</b>
                    
                    结构型模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.3.1" data-path="../设计模式/结构型模型/readme.html">
            
                <a href="../设计模式/结构型模型/readme.html">
            
                    
                        <b>1.15.3.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.2" data-path="../设计模式/结构型模型/享元模式.html">
            
                <a href="../设计模式/结构型模型/享元模式.html">
            
                    
                        <b>1.15.3.2.</b>
                    
                    享元模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.3" data-path="../设计模式/结构型模型/代理模式.html">
            
                <a href="../设计模式/结构型模型/代理模式.html">
            
                    
                        <b>1.15.3.3.</b>
                    
                    代理模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.4" data-path="../设计模式/结构型模型/外观模式.html">
            
                <a href="../设计模式/结构型模型/外观模式.html">
            
                    
                        <b>1.15.3.4.</b>
                    
                    外观模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.5" data-path="../设计模式/结构型模型/桥模式.html">
            
                <a href="../设计模式/结构型模型/桥模式.html">
            
                    
                        <b>1.15.3.5.</b>
                    
                    桥模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.6" data-path="../设计模式/结构型模型/组合模式.html">
            
                <a href="../设计模式/结构型模型/组合模式.html">
            
                    
                        <b>1.15.3.6.</b>
                    
                    组合模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.7" data-path="../设计模式/结构型模型/装饰模式.html">
            
                <a href="../设计模式/结构型模型/装饰模式.html">
            
                    
                        <b>1.15.3.7.</b>
                    
                    装饰模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.8" data-path="../设计模式/结构型模型/适配器模式.html">
            
                <a href="../设计模式/结构型模型/适配器模式.html">
            
                    
                        <b>1.15.3.8.</b>
                    
                    适配器模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15.4" data-path="../设计模式/行为型模型/">
            
                <a href="../设计模式/行为型模型/">
            
                    
                        <b>1.15.4.</b>
                    
                    行为型模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.4.1" data-path="../设计模式/行为型模型/readme.html">
            
                <a href="../设计模式/行为型模型/readme.html">
            
                    
                        <b>1.15.4.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.2" data-path="../设计模式/行为型模型/中介者模式.html">
            
                <a href="../设计模式/行为型模型/中介者模式.html">
            
                    
                        <b>1.15.4.2.</b>
                    
                    中介者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.3" data-path="../设计模式/行为型模型/命令模式.html">
            
                <a href="../设计模式/行为型模型/命令模式.html">
            
                    
                        <b>1.15.4.3.</b>
                    
                    命令模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.4" data-path="../设计模式/行为型模型/备忘录模式.html">
            
                <a href="../设计模式/行为型模型/备忘录模式.html">
            
                    
                        <b>1.15.4.4.</b>
                    
                    备忘录模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.5" data-path="../设计模式/行为型模型/模板方法模式.html">
            
                <a href="../设计模式/行为型模型/模板方法模式.html">
            
                    
                        <b>1.15.4.5.</b>
                    
                    模板方法模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.6" data-path="../设计模式/行为型模型/状态模式.html">
            
                <a href="../设计模式/行为型模型/状态模式.html">
            
                    
                        <b>1.15.4.6.</b>
                    
                    状态模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.7" data-path="../设计模式/行为型模型/策略模式.html">
            
                <a href="../设计模式/行为型模型/策略模式.html">
            
                    
                        <b>1.15.4.7.</b>
                    
                    策略模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.8" data-path="../设计模式/行为型模型/职责链模式.html">
            
                <a href="../设计模式/行为型模型/职责链模式.html">
            
                    
                        <b>1.15.4.8.</b>
                    
                    职责链模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.9" data-path="../设计模式/行为型模型/观察者模式.html">
            
                <a href="../设计模式/行为型模型/观察者模式.html">
            
                    
                        <b>1.15.4.9.</b>
                    
                    观察者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.10" data-path="../设计模式/行为型模型/解释器模式.html">
            
                <a href="../设计模式/行为型模型/解释器模式.html">
            
                    
                        <b>1.15.4.10.</b>
                    
                    解释器模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.11" data-path="../设计模式/行为型模型/访问者模式.html">
            
                <a href="../设计模式/行为型模型/访问者模式.html">
            
                    
                        <b>1.15.4.11.</b>
                    
                    访问者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.12" data-path="../设计模式/行为型模型/迭代器模式.html">
            
                <a href="../设计模式/行为型模型/迭代器模式.html">
            
                    
                        <b>1.15.4.12.</b>
                    
                    迭代器模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >Ccm</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-anchor"></i><ul><li><a href="#cloud-controller-manage">cloud controller manage</a></li></ul></div><a href="#cloud-controller-manage" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="cloud-controller-manage"><a name="cloud-controller-manage" class="anchor-navigation-ex-anchor" href="#cloud-controller-manage"><i class="fa fa-link" aria-hidden="true"></i></a>cloud controller manage</h1>
<p>Kubernetes &#x662F;&#x4E00;&#x4E2A;&#x4E91;&#x539F;&#x751F;&#x5E73;&#x53F0;&#xFF0C;&#x4F46;&#x4E3A;&#x4E86;&#x8BA9; Kubernetes &#x80FD;&#x591F;&#x66F4;&#x597D;&#x5730;&#x8FD0;&#x884C;&#x5728;&#x516C;&#x6709;&#x4E91;&#x5E73;&#x53F0;&#x4E0A;&#xFF0C;&#x80FD;&#x591F;&#x7075;&#x6D3B;&#x5730;&#x4F7F;&#x7528;&#x3001;&#x7BA1;&#x7406;&#x4E91;&#x4E0A;&#x5176;&#x4ED6;&#x7684;&#x57FA;&#x7840;&#x8D44;&#x6E90;&#x548C;&#x57FA;&#x7840;&#x670D;&#x52A1;&#xFF0C;
&#x4E91;&#x5382;&#x5546;&#x9700;&#x8981;&#x5B9E;&#x73B0;&#x81EA;&#x5DF1;&#x7684;&#x9002;&#x914D;&#x5668;&#x3002; 1.6&#x7248;&#x672C;&#x4E4B;&#x524D;&#x5404;&#x4E91;&#x670D;&#x52A1;&#x5546;&#x7684;&#x57FA;&#x7840;&#x8D44;&#x6E90;&#x7BA1;&#x7406;&#x4EE3;&#x7801;&#x90FD;&#x96C6;&#x6210;&#x5728;kubernetes&#x6E90;&#x7801;&#x7684;CloudProvider&#x4E2D;, &#x540E;&#x9762;&#x4E3A;&#x4E86;&#x4E0D;&#x5F71;&#x54CD;kubernetes
&#x7248;&#x672C;&#x7684;&#x53D1;&#x5E03;&#x8FDB;&#x5EA6;&#xFF0C;&#x5C06;&#x5176;&#x4ECE;&#x4E2D;&#x89E3;&#x8026;&#x51FA;&#x6765;&#x3002;&#x7531;&#x5404;&#x4E91;&#x670D;&#x52A1;&#x5546;&#x72EC;&#x81EA;&#x5B9E;&#x73B0;&#x5176;&#x62BD;&#x8C61;&#x51FA;&#x6765;&#x7684;&#x63A5;&#x53E3;&#x5373;&#x53EF;&#x3002;
&#x4E8E;&#x662F;&#x5728; Kubernetes v1.6&#xFF0C;&#x5F15;&#x5165;&#x4E86;cloud-controller-manager(CCM)&#x9879;&#x76EE;&#x3002;</p>
<h3 id="&#x5F00;&#x53D1;ccm-&#x4E91;&#x670D;&#x52A1;&#x5546;&#x9700;&#x8981;&#x5B9E;&#x73B0;&#x54EA;&#x4E9B;&#x63A5;&#x53E3;"><a name="&#x5F00;&#x53D1;ccm-&#x4E91;&#x670D;&#x52A1;&#x5546;&#x9700;&#x8981;&#x5B9E;&#x73B0;&#x54EA;&#x4E9B;&#x63A5;&#x53E3;" class="anchor-navigation-ex-anchor" href="#&#x5F00;&#x53D1;ccm-&#x4E91;&#x670D;&#x52A1;&#x5546;&#x9700;&#x8981;&#x5B9E;&#x73B0;&#x54EA;&#x4E9B;&#x63A5;&#x53E3;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5F00;&#x53D1;CCM &#x4E91;&#x670D;&#x52A1;&#x5546;&#x9700;&#x8981;&#x5B9E;&#x73B0;&#x54EA;&#x4E9B;&#x63A5;&#x53E3;</h3>
<p><a href="https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/cloud-provider/cloud.go" target="_blank">cloudprovider.Interface</a></p>
<p>Interface</p>
<pre class="language-"><code class="lang-go"><span class="token keyword">type</span> Interface <span class="token keyword">interface</span> <span class="token punctuation">{</span>
    <span class="token comment">//&#x3000;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;client&#x3000;&#x548C;&#x3000;kube-apiserver&#x901A;&#x4FE1;,&#x3000;&#x542F;&#x52A8;&#x81EA;&#x5B9A;&#x4E49;&#x63A7;&#x5236;&#x5668;&#xFF0C;&#x4EFB;&#x4F55;&#x4ECE;&#x8FD9;&#x91CC;&#x542F;&#x52A8;&#x7684;goroutine&#x90FD;</span>
    <span class="token comment">//  &#x5FC5;&#x987B;&#x53EF;&#x4EE5;&#x5B89;&#x5168;&#x9000;&#x51FA;</span>
    <span class="token comment">// k8s.io/kubernetes/cmd/cloud-controller-manager/app/controllermanager.go  Line 225 &#x88AB;&#x8C03;&#x7528;</span>
    <span class="token comment">// openstack: return nil</span>
    <span class="token comment">// alibaba: &#x542F;&#x52A8;&#x4E86;route &#x548C;&#x3000;node &#x63A7;&#x5236;&#x5668;</span>
    <span class="token function">Initialize</span><span class="token punctuation">(</span>clientBuilder ControllerClientBuilder<span class="token punctuation">,</span> stop <span class="token operator">&lt;-</span><span class="token keyword">chan</span> <span class="token keyword">struct</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">)</span>

    <span class="token comment">// &#x64CD;&#x4F5C;&#x4E91;&#x670D;&#x52A1;&#x5546;LoadBalancer&#x63A5;&#x53E3;</span>
    <span class="token function">LoadBalancer</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">(</span>LoadBalancer<span class="token punctuation">,</span> <span class="token builtin">bool</span><span class="token punctuation">)</span>

    <span class="token comment">// &#x83B7;&#x53D6;&#x8282;&#x70B9;&#x4FE1;&#x606F;&#x7684;&#x63A5;&#x53E3;</span>
    <span class="token function">Instances</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">(</span>Instances<span class="token punctuation">,</span> <span class="token builtin">bool</span><span class="token punctuation">)</span>

    <span class="token comment">// &#x83B7;&#x53D6;&#x8282;&#x70B9;&#x548C;&#x53EF;&#x7528;&#x533A;&#x7684;&#x76F8;&#x5173;&#x63A5;&#x53E3;</span>
    <span class="token function">Zones</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">(</span>Zones<span class="token punctuation">,</span> <span class="token builtin">bool</span><span class="token punctuation">)</span>

    <span class="token comment">//&#x3000;&#x4E0E;&#x96C6;&#x7FA4;&#x76F8;&#x5173;&#x63A5;&#x53E3;&#xFF0C;&#x3000;&#x53EF;&#x4EE5;&#x4E0D;&#x5B9E;&#x73B0;&#xFF0C;&#x3000;&#x76F4;&#x63A5;return nil, false</span>
    <span class="token function">Clusters</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">(</span>Clusters<span class="token punctuation">,</span> <span class="token builtin">bool</span><span class="token punctuation">)</span>

    <span class="token comment">// &#x4E0E;&#x8DEF;&#x7531;&#x76F8;&#x5173;&#x63A5;&#x53E3;</span>
    <span class="token function">Routes</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">(</span>Routes<span class="token punctuation">,</span> <span class="token builtin">bool</span><span class="token punctuation">)</span>

    <span class="token comment">// &#x4E91;&#x670D;&#x52A1;&#x5546;&#x540D;&#x79F0;, &#x5982;aws, openstack, ali, huawei</span>
    <span class="token function">ProviderName</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token builtin">string</span>

    <span class="token comment">// &#x96C6;&#x7FA4;ID,&#x3000;&#x6682;&#x65F6;&#x53EF;&#x4EE5;&#x4E0D;&#x7528;&#xFF0C;&#x3000;&#x4EE5;&#x540E;&#x5FC5;&#x987B;&#x6709;</span>
    <span class="token function">HasClusterID</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token builtin">bool</span>
<span class="token punctuation">}</span>
</code></pre>
<pre class="language-"><code class="lang-go"><span class="token keyword">type</span> InformerUser <span class="token keyword">interface</span> <span class="token punctuation">{</span>
    <span class="token function">SetInformers</span><span class="token punctuation">(</span>informerFactory informers<span class="token punctuation">.</span>SharedInformerFactory<span class="token punctuation">)</span>
<span class="token punctuation">}</span>
</code></pre>
<pre class="language-"><code class="lang-go"><span class="token keyword">type</span> LoadBalancer <span class="token keyword">interface</span> <span class="token punctuation">{</span>
    <span class="token comment">// &#x901A;&#x8FC7;&#x4F20;&#x5165;service&#x5BF9;&#x8C61;&#xFF0C;&#x83B7;&#x53D6;&#x4E91;&#x670D;&#x52A1;&#x5546;&#x7684;LB exists and its status</span>
    <span class="token function">GetLoadBalancer</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> clusterName <span class="token builtin">string</span><span class="token punctuation">,</span> service <span class="token operator">*</span>v1<span class="token punctuation">.</span>Service<span class="token punctuation">)</span> <span class="token punctuation">(</span>status <span class="token operator">*</span>v1<span class="token punctuation">.</span>LoadBalancerStatus<span class="token punctuation">,</span> exists <span class="token builtin">bool</span><span class="token punctuation">,</span> err <span class="token builtin">error</span><span class="token punctuation">)</span>

    <span class="token comment">// &#x901A;&#x8FC7;&#x4F20;&#x5165;&#x7684;service &#x5BF9;&#x8C61;&#xFF0C;&#x83B7;&#x53D6;LoadBalancerName, &#x521B;&#x5EFA;lb&#x7684;&#x65F6;&#x5019;&#x9ED8;&#x8BA4;&#x4F1A;&#x6839;&#x636E;service uid &#x524D;32&#x4F4D;&#x6765;&#x547D;&#x540D;</span>
    <span class="token function">GetLoadBalancerName</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> clusterName <span class="token builtin">string</span><span class="token punctuation">,</span> service <span class="token operator">*</span>v1<span class="token punctuation">.</span>Service<span class="token punctuation">)</span> <span class="token builtin">string</span>

    <span class="token comment">// service controller &#x76D1;&#x542C;&#x5230; type &#x4FEE;&#x6539;&#x4E3A;LoadBalancher&#x3000;&#x7684;&#x65F6;&#x5019;&#x4F1A;&#x89E6;&#x53D1;&#x8BE5;&#x63A5;&#x53E3;, &#x8C03;&#x7528;ccm &#x53BB;&#x521B;&#x5EFA;&#x3000;LB and EIP(floatIP)</span>
    <span class="token function">EnsureLoadBalancer</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> clusterName <span class="token builtin">string</span><span class="token punctuation">,</span> service <span class="token operator">*</span>v1<span class="token punctuation">.</span>Service<span class="token punctuation">,</span> nodes <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token operator">*</span>v1<span class="token punctuation">.</span>Node<span class="token punctuation">)</span> <span class="token punctuation">(</span><span class="token operator">*</span>v1<span class="token punctuation">.</span>LoadBalancerStatus<span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span>

    <span class="token comment">// service controller &#x76D1;&#x542C;&#x5230; port or node change, &#x8C03;&#x7528;ccm modify lb.Listener or Backend</span>
    <span class="token function">UpdateLoadBalancer</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> clusterName <span class="token builtin">string</span><span class="token punctuation">,</span> service <span class="token operator">*</span>v1<span class="token punctuation">.</span>Service<span class="token punctuation">,</span> nodes <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token operator">*</span>v1<span class="token punctuation">.</span>Node<span class="token punctuation">)</span> <span class="token builtin">error</span>

    <span class="token comment">//&#x3000;service controller &#x76D1;&#x542C;&#x5230;service&#x3000;&#x88AB;&#x5220;&#x9664;&#x6216;&#x8005;type&#x7531;&#x4E8E;LoadBalancer&#x6539;&#x53D8;&#x4E3A;&#x5176;&#x4ED6;&#x7C7B;&#x578B;&#x7684;&#x65F6;&#x5019;&#x89E6;&#x53D1;,&#x8C03;&#x7528;ccm delete LB and EIP</span>
    <span class="token function">EnsureLoadBalancerDeleted</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> clusterName <span class="token builtin">string</span><span class="token punctuation">,</span> service <span class="token operator">*</span>v1<span class="token punctuation">.</span>Service<span class="token punctuation">)</span> <span class="token builtin">error</span>
<span class="token punctuation">}</span>

<span class="token keyword">type</span> Instances <span class="token keyword">interface</span> <span class="token punctuation">{</span>
    <span class="token function">NodeAddresses</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> name types<span class="token punctuation">.</span>NodeName<span class="token punctuation">)</span> <span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token punctuation">]</span>v1<span class="token punctuation">.</span>NodeAddress<span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span>
    <span class="token function">NodeAddressesByProviderID</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> providerID <span class="token builtin">string</span><span class="token punctuation">)</span> <span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token punctuation">]</span>v1<span class="token punctuation">.</span>NodeAddress<span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span>
    <span class="token function">InstanceID</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> nodeName types<span class="token punctuation">.</span>NodeName<span class="token punctuation">)</span> <span class="token punctuation">(</span><span class="token builtin">string</span><span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span>
    <span class="token function">InstanceType</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> name types<span class="token punctuation">.</span>NodeName<span class="token punctuation">)</span> <span class="token punctuation">(</span><span class="token builtin">string</span><span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span>
    <span class="token function">InstanceTypeByProviderID</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> providerID <span class="token builtin">string</span><span class="token punctuation">)</span> <span class="token punctuation">(</span><span class="token builtin">string</span><span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span>
    <span class="token function">AddSSHKeyToAllInstances</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> user <span class="token builtin">string</span><span class="token punctuation">,</span> keyData <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token builtin">byte</span><span class="token punctuation">)</span> <span class="token builtin">error</span>
    <span class="token function">CurrentNodeName</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> hostname <span class="token builtin">string</span><span class="token punctuation">)</span> <span class="token punctuation">(</span>types<span class="token punctuation">.</span>NodeName<span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span>
    <span class="token function">InstanceExistsByProviderID</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> providerID <span class="token builtin">string</span><span class="token punctuation">)</span> <span class="token punctuation">(</span><span class="token builtin">bool</span><span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span>
    <span class="token function">InstanceShutdownByProviderID</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> providerID <span class="token builtin">string</span><span class="token punctuation">)</span> <span class="token punctuation">(</span><span class="token builtin">bool</span><span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span>
<span class="token punctuation">}</span>

<span class="token keyword">type</span> Clusters <span class="token keyword">interface</span> <span class="token punctuation">{</span>
    <span class="token function">ListClusters</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">)</span> <span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token builtin">string</span><span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span>
    <span class="token function">Master</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> clusterName <span class="token builtin">string</span><span class="token punctuation">)</span> <span class="token punctuation">(</span><span class="token builtin">string</span><span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span>
<span class="token punctuation">}</span>

<span class="token keyword">type</span> Routes <span class="token keyword">interface</span> <span class="token punctuation">{</span>
    <span class="token comment">//&#x3000;&#x5217;&#x51FA;&#x5F53;&#x524D;&#x96C6;&#x7FA4;&#x7684;&#x8DEF;&#x7531;&#x89C4;&#x5219;</span>
    <span class="token function">ListRoutes</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> clusterName <span class="token builtin">string</span><span class="token punctuation">)</span> <span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token operator">*</span>Route<span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span>

    <span class="token comment">// &#x5F53;&#x524D;&#x96C6;&#x7FA4;&#x65B0;&#x5EFA;&#x8DEF;&#x7531;&#x89C4;&#x5219;</span>
    <span class="token function">CreateRoute</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> clusterName <span class="token builtin">string</span><span class="token punctuation">,</span> nameHint <span class="token builtin">string</span><span class="token punctuation">,</span> route <span class="token operator">*</span>Route<span class="token punctuation">)</span> <span class="token builtin">error</span>

    <span class="token comment">// &#x5220;&#x9664;&#x8DEF;&#x7531;&#x89C4;&#x5219;</span>
    <span class="token function">DeleteRoute</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> clusterName <span class="token builtin">string</span><span class="token punctuation">,</span> route <span class="token operator">*</span>Route<span class="token punctuation">)</span> <span class="token builtin">error</span>
<span class="token punctuation">}</span>

<span class="token keyword">type</span> Zones <span class="token keyword">interface</span> <span class="token punctuation">{</span>
    <span class="token function">GetZone</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">)</span> <span class="token punctuation">(</span>Zone<span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span>
    <span class="token function">GetZoneByProviderID</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> providerID <span class="token builtin">string</span><span class="token punctuation">)</span> <span class="token punctuation">(</span>Zone<span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span>
    <span class="token function">GetZoneByNodeName</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> nodeName types<span class="token punctuation">.</span>NodeName<span class="token punctuation">)</span> <span class="token punctuation">(</span>Zone<span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span>
<span class="token punctuation">}</span>

<span class="token keyword">type</span> PVLabeler <span class="token keyword">interface</span> <span class="token punctuation">{</span>
    <span class="token function">GetLabelsForVolume</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> pv <span class="token operator">*</span>v1<span class="token punctuation">.</span>PersistentVolume<span class="token punctuation">)</span> <span class="token punctuation">(</span><span class="token keyword">map</span><span class="token punctuation">[</span><span class="token builtin">string</span><span class="token punctuation">]</span><span class="token builtin">string</span><span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span>
<span class="token punctuation">}</span>
</code></pre>
<h3 id="cloudprovider-&#x5230;&#x3000;ccm&#x3000;&#x7684;&#x91CD;&#x6784;&#x6F14;&#x8FDB;"><a name="cloudprovider-&#x5230;&#x3000;ccm&#x3000;&#x7684;&#x91CD;&#x6784;&#x6F14;&#x8FDB;" class="anchor-navigation-ex-anchor" href="#cloudprovider-&#x5230;&#x3000;ccm&#x3000;&#x7684;&#x91CD;&#x6784;&#x6F14;&#x8FDB;"><i class="fa fa-link" aria-hidden="true"></i></a>cloudProvider &#x5230;&#x3000;CCM&#x3000;&#x7684;&#x91CD;&#x6784;&#x6F14;&#x8FDB;</h3>
<p>&#x56E0;&#x4E3A;&#x539F;&#x5148;&#x7684; Cloud Provider &#x4E0E; Mater &#x4E2D;&#x7684;&#x7EC4;&#x4EF6; kube-controller-manager&#x3001;kube-apiserver &#x4EE5;&#x53CA; Node &#x4E2D;&#x7684;&#x7EC4;&#x4EF6;
 kubelet &#x8026;&#x5408;&#x5F88;&#x7D27;&#x5BC6;&#xFF0C;&#x6240;&#x4EE5;&#x8FD9;&#x4E09;&#x4E2A;&#x7EC4;&#x4EF6;&#x4E5F;&#x9700;&#x8981;&#x8FDB;&#x884C;&#x91CD;&#x6784;&#x3002;</p>
<ul>
<li><p>kube-controller-manager &#x7684;&#x91CD;&#x6784;&#x7B56;&#x7565;</p>
<ul>
<li>Route Controller &#x79FB;&#x5165; CCM</li>
<li>Service Controller &#x79FB;&#x5165; CCM</li>
<li>PersistentVolumeLabel Controller &#x79FB;&#x5165; CCM</li>
<li>Node Controller &#x79FB;&#x5165; CCM, &#x5E76;&#x4E14;&#x65B0;&#x589E;&#x529F;&#x80FD;<ul>
<li>CIDR &#x7684;&#x7BA1;&#x7406;</li>
<li>&#x76D1;&#x63A7;&#x8282;&#x70B9;&#x7684;&#x72B6;&#x6001;</li>
<li>&#x8282;&#x70B9;Pod&#x7684;&#x9A71;&#x9010;&#x7B56;&#x7565;</li>
</ul>
</li>
</ul>
</li>
<li><p>kube-apiserver &#x7684;&#x91CD;&#x6784;&#x7B56;&#x7565;</p>
<ul>
<li>&#x5206;&#x53D1;SSH Keys &#x7531;CCM&#x5B9E;&#x73B0;</li>
<li>PV&#x7684;Adminssion Controller&#x3000;&#x7531; kubelet&#x5B9E;&#x73B0;</li>
</ul>
</li>
<li><p>kubelet&#x7684;&#x91CD;&#x6784;&#x7B56;&#x7565;</p>
<ul>
<li>kubelet &#x9700;&#x8981;&#x589E;&#x52A0;&#x4E00;&#x4E2A;&#x65B0;&#x529F;&#x80FD;&#xFF1A;&#x5728; CCM &#x8FD8;&#x672A;&#x521D;&#x59CB;&#x5316; kubelet &#x6240;&#x5728;&#x8282;&#x70B9;&#x65F6;&#xFF0C;&#x9700;&#x6807;&#x8BB0;&#x6B64;&#x8282;&#x70B9;&#x7C7B;&#x4F3C;&#x201C; NotReady &#x201D;&#x7684;&#x72B6;&#x6001;&#xFF0C;&#x9632;&#x6B62;
scheduler &#x8C03;&#x5EA6; Pod &#x5230;&#x6B64;&#x8282;&#x70B9;&#x65F6;&#x4EA7;&#x751F;&#x4E00;&#x7CFB;&#x5217;&#x9519;&#x8BEF;&#x3002;&#x6B64;&#x529F;&#x80FD;&#x901A;&#x8FC7;&#x7ED9;&#x8282;&#x70B9;&#x52A0;&#x4E0A;&#x5982;&#x4E0B; Taints &#x5E76;&#x5728; CCM &#x521D;&#x59CB;&#x5316;&#x540E;&#x5220;&#x53BB;&#x6B64; Taints &#x6765;&#x5B9E;&#x73B0;</li>
</ul>
</li>
</ul>
<h3 id="ccm&#x3000;&#x67B6;&#x6784;&#x4ECB;&#x7ECD;"><a name="ccm&#x3000;&#x67B6;&#x6784;&#x4ECB;&#x7ECD;" class="anchor-navigation-ex-anchor" href="#ccm&#x3000;&#x67B6;&#x6784;&#x4ECB;&#x7ECD;"><i class="fa fa-link" aria-hidden="true"></i></a>CCM&#x3000;&#x67B6;&#x6784;&#x4ECB;&#x7ECD;</h3>
<p><img src="https://cai-hello-1253732611.cos.ap-shanghai.myqcloud.com/share/155236.png" alt="client-go"></p>
<h4 id="node-controller"><a name="node-controller" class="anchor-navigation-ex-anchor" href="#node-controller"><i class="fa fa-link" aria-hidden="true"></i></a>node controller</h4>
<p>&#x4F7F;&#x7528; Cloud Provider &#x6765;&#x68C0;&#x67E5; Node &#x662F;&#x5426;&#x5DF2;&#x7ECF;&#x5728;&#x4E91;&#x4E0A;&#x88AB;&#x5220;&#x9664;&#x4E86;&#x3002;&#x5982;&#x679C; Cloud Provider &#x8FD4;&#x56DE;&#x6709; Node &#x88AB;&#x5220;&#x9664;&#xFF0C;&#x90A3;&#x4E48; 
Node Controller &#x7ACB;&#x9A6C;&#x5C31;&#x4F1A;&#x628A;&#x6B64; Node &#x4ECE; Kubernetes &#x4E2D;&#x5220;&#x9664;&#x3002;</p>
<h4 id="service-controller"><a name="service-controller" class="anchor-navigation-ex-anchor" href="#service-controller"><i class="fa fa-link" aria-hidden="true"></i></a>service controller</h4>
<p>&#x8D1F;&#x8D23;&#x4E3A;type: LoadBalancer&#x7684;service &#x521B;&#x5EFA;&#xFF0C;&#x5220;&#x9664;&#xFF0C;&#x66F4;&#x65B0;LB and EIP.</p>
<h4 id="route-controller"><a name="route-controller" class="anchor-navigation-ex-anchor" href="#route-controller"><i class="fa fa-link" aria-hidden="true"></i></a>route controller</h4>
<p>&#x914D;&#x7F6E;node&#x8DEF;&#x7531;.kubernetes &#x7F51;&#x7EDC;&#x7684;&#x57FA;&#x672C;&#x539F;&#x5219;&#x662F;&#x6BCF;&#x4E2A;pod&#x90FD;&#x8981;&#x6709;&#x4E00;&#x4E2A;&#x72EC;&#x7ACB;ip&#x5730;&#x5740;,&#x800C;&#x4E14;&#x5047;&#x5B9A;&#x6240;&#x6709;&#x7684;pod&#x90FD;&#x5728;&#x76F4;&#x63A5;&#x8FDE;&#x901A;&#x7684;&#x6241;&#x5E73;&#x7F51;&#x7EDC;&#x4E2D;.
&#x800C;&#x4E91;&#x4E0A;node&#x7684;&#x57FA;&#x7840;&#x8BBE;&#x65BD;&#x662F;&#x4E91;&#x670D;&#x52A1;&#x5546;&#x63D0;&#x4F9B;&#x7684;,&#x6240;&#x4EE5; Route Controller &#x9700;&#x8981;&#x8C03;&#x7528; Cloud Provider &#x6765;&#x914D;&#x7F6E;&#x4E91;&#x4E0A;&#x7684; Node &#x7684;&#x5E95;&#x5C42;&#x8DEF;&#x7531;.</p>
<h4 id="pvlabel-controller"><a name="pvlabel-controller" class="anchor-navigation-ex-anchor" href="#pvlabel-controller"><i class="fa fa-link" aria-hidden="true"></i></a>pvLabel controller</h4>
<p>&#x4F7F;&#x7528; Cloud Provider &#x6765;&#x521B;&#x5EFA;&#x3001;&#x5220;&#x9664;&#x3001;&#x6302;&#x8F7D;&#x3001;&#x5378;&#x8F7D; Node &#x4E0A;&#x7684;&#x5377;&#xFF0C;&#x8FD9;&#x662F;&#x56E0;&#x4E3A;&#x5377;&#x4E5F;&#x662F;&#x4E91;&#x5382;&#x5546;&#x989D;&#x5916;&#x63D0;&#x4F9B;&#x7684;&#x4E91;&#x5B58;&#x50A8;&#x670D;&#x52A1;&#x3002;</p>
<h3 id="ccm-&#x6E90;&#x7801;&#x5206;&#x6790;"><a name="ccm-&#x6E90;&#x7801;&#x5206;&#x6790;" class="anchor-navigation-ex-anchor" href="#ccm-&#x6E90;&#x7801;&#x5206;&#x6790;"><i class="fa fa-link" aria-hidden="true"></i></a>CCM &#x6E90;&#x7801;&#x5206;&#x6790;</h3>
<p>&#x672C;&#x6587;&#x7684;&#x6E90;&#x7801;&#x5206;&#x6790;&#x662F;&#x4EE5;openstack&#x4E3A;&#x57FA;&#x7840;:<a href="https://github.com/kubernetes/cloud-provider-openstack:origin/release-1.17" target="_blank">https://github.com/kubernetes/cloud-provider-openstack:origin/release-1.17</a>
kuberentes 1.17</p>
<p>&#x542F;&#x52A8;&#x6D41;&#x7A0B;</p>
<ul>
<li>1.&#x9879;&#x76EE;&#x542F;&#x52A8;&#x540E;&#xFF0C;&#x5148;&#x6267;&#x884C;&#x6240;&#x6709;init&#x65B9;&#x6CD5;&#xFF0C;&#x6CE8;&#x518C; getCloudProvider&#x65B9;&#x6CD5;&#xFF08;map[&#x4E91;&#x670D;&#x52A1;&#x5546;&#x540D;&#x79F0;]&#x521B;&#x5EFA;cloudProvider&#x65B9;&#x6CD5;&#xFF09;</li>
</ul>
<p>/root/go/src/k8s.io/cloud-provider-openstack/pkg/cloudprovider/providers/openstack/openstack.go</p>
<pre class="language-"><code>line: 251, &#x5B8C;&#x6210;cloudProvider&#x3000;&#x83B7;&#x53D6;&#x65B9;&#x6CD5;&#x7684;&#x6CE8;&#x518C;
func init() {
    RegisterMetrics()

    cloudprovider.RegisterCloudProvider(ProviderName, func(config io.Reader) (cloudprovider.Interface, error) {
        cfg, err := ReadConfig(config)
        logcfg(cfg)
        if err != nil {
            return nil, err
        }
        // &#x8FD9;&#x91CC;&#x53EF;&#x4EE5;new&#x3000;&#x4E00;&#x4E2A;&#x81EA;&#x5DF1;&#x7684;CloudProvider&#x5BF9;&#x8C61;(&#x524D;&#x63D0;&#x662F;&#x5B9E;&#x73B0;&#x63A5;&#x53E3;cloudprovider.Interface),
        cloud, err := NewOpenStack(cfg)
        if err != nil {
            klog.V(1).Infof(&quot;New openstack client created failed with config&quot;)
        }
        return cloud, err
    })
}
</code></pre><p>/root/go/src/k8s.io/cloud-provider-.../vendor/k8s.io/cloud-provider/plugins.go</p>
<pre class="language-"><code>// RegisterCloudProvider registers a cloudprovider.Factory by name.  This
// is expected to happen during app startup.
func RegisterCloudProvider(name string, cloud Factory) {
    providersMutex.Lock()
    defer providersMutex.Unlock()
    if _, found := providers[name]; found {
        klog.Fatalf(&quot;Cloud provider %q was registered twice&quot;, name)
    }
    klog.V(1).Infof(&quot;Registered cloud provider %q&quot;, name)
    providers[name] = cloud
}

// provider&#x662F;&#x4E00;&#x4E2A;map, 
// key: &#x4E91;&#x670D;&#x52A1;&#x5546;&#x540D;&#x79F0;
// value: &#x5DE5;&#x5382;&#x65B9;&#x6CD5;&#xFF0C;&#x5373;&#x521B;&#x5EFA;CloudProvider&#x7684;&#x65B9;&#x6CD5;
providers                = make(map[string]Factory)

// Factory is a function that returns a cloudprovider.Interface.
// The config parameter provides an io.Reader handler to the factory in
// order to load specific configurations. If no configuration is provided
// the parameter is nil.
type Factory func(config io.Reader) (Interface, error)
</code></pre><ul>
<li>2.main &#x51FD;&#x6570;&#x5165;&#x53E3;&#x542F;&#x52A8;&#x7A0B;&#x5E8F;<ul>
<li>&#x751F;&#x6210;ccm&#x3000;&#x9ED8;&#x8BA4;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x5BF9;&#x8C61;</li>
<li>&#x89E3;&#x6790;&#x542F;&#x52A8;&#x547D;&#x4EE4;&#x884C;&#x53C2;&#x6570;
  verflag.PrintAndExitIfRequested()
  utilflag
  pflag.CommandLine.SetNormalizeFunc
  pflag.CommandLine.AddGoFlagSet
  logs.InitLogs()</li>
<li>&#x8C03;&#x7528; k8s&#x4E2D;&#x7684;cloud-controller-manager.Run()</li>
<li>InitCloudProvider, err, nil, and clusterID&#x3000;&#x6821;&#x9A8C;</li>
<li>configz.New&#x3000;&#x4E0D;&#x61C2;</li>
<li>create HealthChecker</li>
<li>create (&#x5B89;&#x5168;&#x548C;&#x4E0D;&#x5B89;&#x5168;)httpServer</li>
<li>&#x5B9A;&#x4E49;controller&#x542F;&#x52A8;&#x51FD;&#x6570;</li>
<li>&#x9009;&#x62E9;&#x53C2;&#x6570;&#x6821;&#x9A8C;&#x3000;--leader-elect&#x3000;
  false:<pre class="language-"><code>  &#x6309;&#x987A;&#x5E8F;&#x542F;&#x52A8;controller
  select{}&#x3000;&#x7A0B;&#x5E8F;&#x963B;&#x585E;
</code></pre>  true:<pre class="language-"><code>  append(healthCheck,NewLeaderHealthzAdaptor)
  create lock(&#x9501;&#x8D44;&#x6E90;&#x7C7B;&#x578B;&#xFF0C;namespace, name,corev1Client,coorinationv1Client,rlconfig)
  try become the leader and start cloud controller manager loops
</code></pre></li>
</ul>
</li>
</ul>
<pre class="language-"><code class="lang-go"><span class="token keyword">package</span> main

<span class="token keyword">import</span> <span class="token punctuation">(</span>
    goflag <span class="token string">&quot;flag&quot;</span>
    <span class="token string">&quot;k8s.io/apimachinery/pkg/util/wait&quot;</span>
    <span class="token string">&quot;k8s.io/apiserver/pkg/server/healthz&quot;</span>
    <span class="token string">&quot;k8s.io/cloud-provider-huawei/huawei&quot;</span>
    <span class="token string">&quot;k8s.io/cloud-provider-huawei/pkg/version&quot;</span>
    <span class="token string">&quot;k8s.io/component-base/cli/flag&quot;</span>
    <span class="token string">&quot;k8s.io/component-base/logs&quot;</span>
    <span class="token boolean">_</span> <span class="token string">&quot;k8s.io/component-base/metrics/prometheus/restclient&quot;</span> <span class="token comment">// for client metric registration</span>
    <span class="token boolean">_</span> <span class="token string">&quot;k8s.io/component-base/metrics/prometheus/version&quot;</span>    <span class="token comment">// for version metric registration</span>
    <span class="token string">&quot;k8s.io/component-base/version/verflag&quot;</span>
    <span class="token string">&quot;k8s.io/klog&quot;</span>
    <span class="token string">&quot;k8s.io/kubernetes/cmd/cloud-controller-manager/app&quot;</span>
    <span class="token string">&quot;k8s.io/kubernetes/cmd/cloud-controller-manager/app/options&quot;</span>
    <span class="token boolean">_</span> <span class="token string">&quot;k8s.io/kubernetes/pkg/features&quot;</span> <span class="token comment">// add the kubernetes feature gates</span>
    utilflag <span class="token string">&quot;k8s.io/kubernetes/pkg/util/flag&quot;</span>
    <span class="token string">&quot;net/http&quot;</span>
    <span class="token string">&quot;os&quot;</span>

    <span class="token string">&quot;github.com/spf13/cobra&quot;</span>
    <span class="token string">&quot;github.com/spf13/pflag&quot;</span>
<span class="token punctuation">)</span>

<span class="token keyword">func</span> <span class="token function">init</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    mux <span class="token operator">:=</span> http<span class="token punctuation">.</span><span class="token function">NewServeMux</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    healthz<span class="token punctuation">.</span><span class="token function">InstallHandler</span><span class="token punctuation">(</span>mux<span class="token punctuation">)</span>
    version<span class="token punctuation">.</span>Version <span class="token operator">=</span> <span class="token string">&quot;1.17&quot;</span>
<span class="token punctuation">}</span>

<span class="token keyword">func</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token comment">// &#x83B7;&#x53D6;ccm&#x9ED8;&#x8BA4;&#x914D;&#x7F6E;&#x6587;&#x4EF6;</span>
    s<span class="token punctuation">,</span> err <span class="token operator">:=</span> options<span class="token punctuation">.</span><span class="token function">NewCloudControllerManagerOptions</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword">if</span> err <span class="token operator">!=</span> <span class="token boolean">nil</span> <span class="token punctuation">{</span>
        klog<span class="token punctuation">.</span><span class="token function">Fatalf</span><span class="token punctuation">(</span><span class="token string">&quot;unable to initialize command options: %v&quot;</span><span class="token punctuation">,</span> err<span class="token punctuation">)</span>
    <span class="token punctuation">}</span>

    <span class="token comment">//&#x3000;&#x4F7F;&#x7528;lease&#x4F1A;&#x62A5;&#x9519;, &#x9700;&#x8981;&#x7EE7;&#x7EED;&#x63A2;&#x7A76;</span>
    s<span class="token punctuation">.</span>Generic<span class="token punctuation">.</span>LeaderElection<span class="token punctuation">.</span>ResourceLock <span class="token operator">=</span> <span class="token string">&quot;endpoints&quot;</span>

    <span class="token comment">// CLI&#x547D;&#x4EE4;&#x884C;&#x7684;golang&#x5E93;&#xFF0C;&#x4E5F;&#x662F;&#x4E00;&#x4E2A;&#x751F;&#x6210;&#x7A0B;&#x5E8F;&#x5E94;&#x7528;&#x548C;&#x547D;&#x4EE4;&#x884C;&#x6587;&#x4EF6;&#x7684;&#x7A0B;&#x5E8F;</span>
    <span class="token comment">// &#x5728;command.Run&#x4E2D;&#x5B8C;&#x6210;config&#x751F;&#x6210;&#x548C;ccm&#x542F;&#x52A8;</span>
    command <span class="token operator">:=</span> <span class="token operator">&amp;</span>cobra<span class="token punctuation">.</span>Command<span class="token punctuation">{</span>
        Use<span class="token punctuation">:</span> <span class="token string">&quot;huawei cloud controller manager&quot;</span><span class="token punctuation">,</span>
        Long<span class="token punctuation">:</span> <span class="token string">`The Cloud controller manager is a daemon that embeds
the cloud specific control loops shipped with Kubernetes.`</span><span class="token punctuation">,</span>
        Run<span class="token punctuation">:</span> <span class="token keyword">func</span><span class="token punctuation">(</span>cmd <span class="token operator">*</span>cobra<span class="token punctuation">.</span>Command<span class="token punctuation">,</span> args <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token builtin">string</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>

            <span class="token comment">// &#x5982;&#x679C;&#x6709;&#x8BF7;&#x6C42;&#x53C2;&#x6570; --version &#x5219;&#x6253;&#x5370;kuberents&#x3000;&#x7248;&#x672C;</span>
            verflag<span class="token punctuation">.</span><span class="token function">PrintAndExitIfRequested</span><span class="token punctuation">(</span><span class="token punctuation">)</span>

            <span class="token comment">// &#x6253;&#x5370;&#x6240;&#x6709;&#x547D;&#x4EE4;flag and value</span>
            utilflag<span class="token punctuation">.</span><span class="token function">PrintFlags</span><span class="token punctuation">(</span>cmd<span class="token punctuation">.</span><span class="token function">Flags</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>

            <span class="token comment">// &#x9A8C;&#x8BC1;KnownControllers key &#x662F;&#x5426;&#x5305;&#x542B;&#x4E86;GenericControllerManagerConfiguration.Controllers&#x4E2D;&#x7684;&#x6240;&#x6709;&#x63A7;&#x5236;&#x5668;</span>
            <span class="token comment">//&#x83B7;&#x53D6;ccm&#x3000;config object</span>
            c<span class="token punctuation">,</span> err <span class="token operator">:=</span> s<span class="token punctuation">.</span><span class="token function">Config</span><span class="token punctuation">(</span>app<span class="token punctuation">.</span><span class="token function">KnownControllers</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> app<span class="token punctuation">.</span>ControllersDisabledByDefault<span class="token punctuation">.</span><span class="token function">List</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
            <span class="token keyword">if</span> err <span class="token operator">!=</span> <span class="token boolean">nil</span> <span class="token punctuation">{</span>
                klog<span class="token punctuation">.</span><span class="token function">Error</span><span class="token punctuation">(</span>os<span class="token punctuation">.</span>Stderr<span class="token punctuation">,</span> err<span class="token punctuation">)</span>
                os<span class="token punctuation">.</span><span class="token function">Exit</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span>
            <span class="token punctuation">}</span>

            <span class="token comment">// &#x542F;&#x52A8;CCM, &#x4F1A;&#x6267;&#x884C; node, route, service, pvLabel controller</span>
            <span class="token keyword">if</span> err <span class="token operator">:=</span> app<span class="token punctuation">.</span><span class="token function">Run</span><span class="token punctuation">(</span>c<span class="token punctuation">.</span><span class="token function">Complete</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> wait<span class="token punctuation">.</span>NeverStop<span class="token punctuation">)</span><span class="token punctuation">;</span> err <span class="token operator">!=</span> <span class="token boolean">nil</span> <span class="token punctuation">{</span>
                klog<span class="token punctuation">.</span><span class="token function">Error</span><span class="token punctuation">(</span>os<span class="token punctuation">.</span>Stderr<span class="token punctuation">,</span> err<span class="token punctuation">)</span>
                os<span class="token punctuation">.</span><span class="token function">Exit</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">}</span>

    <span class="token comment">//&#x3000;&#x751F;&#x6210;CLI&#x9ED8;&#x8BA4;&#x542F;&#x52A8;&#x53C2;&#x6570;&#x5BF9;</span>
    fs <span class="token operator">:=</span> command<span class="token punctuation">.</span><span class="token function">Flags</span><span class="token punctuation">(</span><span class="token punctuation">)</span>

    <span class="token comment">//&#x3000;&#x5C06;ccm config&#x3000;&#x7684;&#x53C2;&#x6570;&#x5BF9;&#x3000;&#x79FB;&#x5165;&#x3000;CLI&#x7684;&#x542F;&#x52A8;&#x3000;&#x53C2;&#x6570;&#x4E0E;&#x5BF9;&#x4E2D;</span>
    namedFlagSets <span class="token operator">:=</span> s<span class="token punctuation">.</span><span class="token function">Flags</span><span class="token punctuation">(</span>app<span class="token punctuation">.</span><span class="token function">KnownControllers</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> app<span class="token punctuation">.</span>ControllersDisabledByDefault<span class="token punctuation">.</span><span class="token function">List</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">for</span> <span class="token boolean">_</span><span class="token punctuation">,</span> f <span class="token operator">:=</span> <span class="token keyword">range</span> namedFlagSets<span class="token punctuation">.</span>FlagSets <span class="token punctuation">{</span>
        fs<span class="token punctuation">.</span><span class="token function">AddFlagSet</span><span class="token punctuation">(</span>f<span class="token punctuation">)</span>
    <span class="token punctuation">}</span>

    pflag<span class="token punctuation">.</span>CommandLine<span class="token punctuation">.</span><span class="token function">SetNormalizeFunc</span><span class="token punctuation">(</span>flag<span class="token punctuation">.</span>WordSepNormalizeFunc<span class="token punctuation">)</span>
    pflag<span class="token punctuation">.</span>CommandLine<span class="token punctuation">.</span><span class="token function">AddGoFlagSet</span><span class="token punctuation">(</span>goflag<span class="token punctuation">.</span>CommandLine<span class="token punctuation">)</span>
    logs<span class="token punctuation">.</span><span class="token function">InitLogs</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword">defer</span> logs<span class="token punctuation">.</span><span class="token function">FlushLogs</span><span class="token punctuation">(</span><span class="token punctuation">)</span>

    klog<span class="token punctuation">.</span><span class="token function">Infof</span><span class="token punctuation">(</span><span class="token string">&quot;huawei cloud provider version: %s&quot;</span><span class="token punctuation">,</span> version<span class="token punctuation">.</span>Version<span class="token punctuation">)</span>

    <span class="token comment">//&#x3000;&#x7701;&#x53BB;&#x4ECE;&#x542F;&#x52A8;&#x547D;&#x4EE4;&#x8D4B;&#x503C;&#x7684;&#x6B65;&#x9AA4;</span>
    s<span class="token punctuation">.</span>KubeCloudShared<span class="token punctuation">.</span>CloudProvider<span class="token punctuation">.</span>Name <span class="token operator">=</span> huawei<span class="token punctuation">.</span>ProviderName

    <span class="token comment">// &#x6267;&#x884C;cli&#x542F;&#x52A8;&#x547D;&#x4EE4;</span>
    <span class="token keyword">if</span> err <span class="token operator">:=</span> command<span class="token punctuation">.</span><span class="token function">Execute</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> err <span class="token operator">!=</span> <span class="token boolean">nil</span> <span class="token punctuation">{</span>
        klog<span class="token punctuation">.</span><span class="token function">Error</span><span class="token punctuation">(</span>os<span class="token punctuation">.</span>Stderr<span class="token punctuation">,</span> err<span class="token punctuation">)</span>
        os<span class="token punctuation">.</span><span class="token function">Exit</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
<ul>
<li><p>3.&#x542F;&#x52A8;&#x6240;&#x6709;&#x63A7;&#x5236;&#x5668;, &#x5F00;&#x59CB;&#x76D1;&#x542C;&#x8D44;&#x6E90;&#x53D8;&#x5316;
/root/go/pkg/mod/k8s.io/kubernetes@v1.17.4/cmd/cloud-controller-manager/app/core.go</p>
</li>
<li><p>cloud-node</p>
<ul>
<li>UpdateNodeStatus updates the node status, such as node addresses</li>
</ul>
</li>
<li>cloud-node-lifecycle<ul>
<li>when you shutdown nodes, will delete node from cluster</li>
</ul>
</li>
<li>service<ul>
<li>update loadbalancer</li>
</ul>
</li>
<li>route<ul>
<li>update node cidr</li>
</ul>
</li>
<li>pvController<ul>
<li>&#x5DF2;&#x7ECF;&#x4ECE;core&#x4E2D;&#x79FB;&#x9664;</li>
</ul>
</li>
</ul>
<pre class="language-"><code class="lang-go"><span class="token comment">// Run runs the ExternalCMServer.  This should never exit.</span>
<span class="token keyword">func</span> <span class="token function">Run</span><span class="token punctuation">(</span>c <span class="token operator">*</span>cloudcontrollerconfig<span class="token punctuation">.</span>CompletedConfig<span class="token punctuation">,</span> stopCh <span class="token operator">&lt;-</span><span class="token keyword">chan</span> <span class="token keyword">struct</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token builtin">error</span> <span class="token punctuation">{</span>

    <span class="token comment">// &#x83B7;&#x53D6;cloudProvider&#x5BF9;&#x8C61;, &#x524D;&#x9762;&#x6211;&#x4EEC;&#x5DF2;&#x7ECF;&#x901A;&#x8FC7;cloudprovider.RegisterCloudProvider&#x3000;&#x628A;get cloudProvider &#x7684;&#x65B9;&#x6CD5;&#x5DF2;&#x7ECF;&#x6CE8;&#x518C;</span>
    cloud<span class="token punctuation">,</span> err <span class="token operator">:=</span> cloudprovider<span class="token punctuation">.</span><span class="token function">InitCloudProvider</span><span class="token punctuation">(</span>c<span class="token punctuation">.</span>ComponentConfig<span class="token punctuation">.</span>KubeCloudShared<span class="token punctuation">.</span>CloudProvider<span class="token punctuation">.</span>Name<span class="token punctuation">,</span> c<span class="token punctuation">.</span>ComponentConfig<span class="token punctuation">.</span>KubeCloudShared<span class="token punctuation">.</span>CloudProvider<span class="token punctuation">.</span>CloudConfigFile<span class="token punctuation">)</span>
    <span class="token operator">...</span><span class="token punctuation">.</span><span class="token punctuation">.</span>

    <span class="token comment">// &#x5B9A;&#x4E49;&#x542F;&#x52A8;&#x63A7;&#x5236;&#x5668;&#x65B9;&#x6CD5;</span>
    <span class="token comment">// newControllerInitializers()&#x3000;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;map, &#x91CC;&#x9762;&#x5DF2;&#x7ECF;&#x5B58;&#x653E;&#x4E86;node, route, service, pvLabel&#x3000;controller</span>
    run <span class="token operator">:=</span> <span class="token keyword">func</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">if</span> err <span class="token operator">:=</span> <span class="token function">startControllers</span><span class="token punctuation">(</span>c<span class="token punctuation">,</span> ctx<span class="token punctuation">.</span><span class="token function">Done</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> cloud<span class="token punctuation">,</span> <span class="token function">newControllerInitializers</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span> err <span class="token operator">!=</span> <span class="token boolean">nil</span> <span class="token punctuation">{</span>
            klog<span class="token punctuation">.</span><span class="token function">Fatalf</span><span class="token punctuation">(</span><span class="token string">&quot;error running controllers: %v&quot;</span><span class="token punctuation">,</span> err<span class="token punctuation">)</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>

    <span class="token comment">//&#x3000;&#x9009;&#x4E3B;</span>
    leaderelection<span class="token punctuation">.</span><span class="token function">RunOrDie</span><span class="token punctuation">(</span>context<span class="token punctuation">.</span><span class="token function">TODO</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> leaderelection<span class="token punctuation">.</span>LeaderElectionConfig<span class="token punctuation">{</span>
        Lock<span class="token punctuation">:</span>          rl<span class="token punctuation">,</span>
        LeaseDuration<span class="token punctuation">:</span> c<span class="token punctuation">.</span>ComponentConfig<span class="token punctuation">.</span>Generic<span class="token punctuation">.</span>LeaderElection<span class="token punctuation">.</span>LeaseDuration<span class="token punctuation">.</span>Duration<span class="token punctuation">,</span>
        RenewDeadline<span class="token punctuation">:</span> c<span class="token punctuation">.</span>ComponentConfig<span class="token punctuation">.</span>Generic<span class="token punctuation">.</span>LeaderElection<span class="token punctuation">.</span>RenewDeadline<span class="token punctuation">.</span>Duration<span class="token punctuation">,</span>
        RetryPeriod<span class="token punctuation">:</span>   c<span class="token punctuation">.</span>ComponentConfig<span class="token punctuation">.</span>Generic<span class="token punctuation">.</span>LeaderElection<span class="token punctuation">.</span>RetryPeriod<span class="token punctuation">.</span>Duration<span class="token punctuation">,</span>
        Callbacks<span class="token punctuation">:</span> leaderelection<span class="token punctuation">.</span>LeaderCallbacks<span class="token punctuation">{</span>
            OnStartedLeading<span class="token punctuation">:</span> run<span class="token punctuation">,</span> <span class="token comment">//&#x542F;&#x52A8;&#x63A7;&#x5236;&#x5668;</span>
            OnStoppedLeading<span class="token punctuation">:</span> <span class="token keyword">func</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                klog<span class="token punctuation">.</span><span class="token function">Fatalf</span><span class="token punctuation">(</span><span class="token string">&quot;leaderelection lost&quot;</span><span class="token punctuation">)</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        WatchDog<span class="token punctuation">:</span> electionChecker<span class="token punctuation">,</span>
        Name<span class="token punctuation">:</span>     <span class="token string">&quot;cloud-controller-manager&quot;</span><span class="token punctuation">,</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span>
    <span class="token function">panic</span><span class="token punctuation">(</span><span class="token string">&quot;unreachable&quot;</span><span class="token punctuation">)</span>
<span class="token punctuation">}</span>
</code></pre>
<p>/root/go/pkg/mod/k8s.io/kubernetes@v1.17.4/cmd/cloud-controller-manager/app/controllermanager.go
ccm 4&#x4E2A;&#x63A7;&#x5236;&#x5668;</p>
<pre class="language-"><code class="lang-go"><span class="token comment">// line 139</span>
<span class="token comment">// initFunc is used to launch a particular controller.  It may run additional &quot;should I activate checks&quot;.</span>
<span class="token comment">// Any error returned will cause the controller process to `Fatal`</span>
<span class="token comment">// The bool indicates whether the controller was enabled.</span>
<span class="token keyword">type</span> initFunc <span class="token keyword">func</span><span class="token punctuation">(</span>ctx <span class="token operator">*</span>cloudcontrollerconfig<span class="token punctuation">.</span>CompletedConfig<span class="token punctuation">,</span> cloud cloudprovider<span class="token punctuation">.</span>Interface<span class="token punctuation">,</span> stop <span class="token operator">&lt;-</span><span class="token keyword">chan</span> <span class="token keyword">struct</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token punctuation">(</span>debuggingHandler http<span class="token punctuation">.</span>Handler<span class="token punctuation">,</span> enabled <span class="token builtin">bool</span><span class="token punctuation">,</span> err <span class="token builtin">error</span><span class="token punctuation">)</span>

<span class="token comment">// KnownControllers indicate the default controller we are known.</span>
<span class="token keyword">func</span> <span class="token function">KnownControllers</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token builtin">string</span> <span class="token punctuation">{</span>
    ret <span class="token operator">:=</span> sets<span class="token punctuation">.</span><span class="token function">StringKeySet</span><span class="token punctuation">(</span><span class="token function">newControllerInitializers</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">return</span> ret<span class="token punctuation">.</span><span class="token function">List</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token punctuation">}</span>

<span class="token comment">// ControllersDisabledByDefault is the controller disabled default when starting cloud-controller managers.</span>
<span class="token keyword">var</span> ControllersDisabledByDefault <span class="token operator">=</span> sets<span class="token punctuation">.</span><span class="token function">NewString</span><span class="token punctuation">(</span><span class="token punctuation">)</span>

<span class="token comment">// newControllerInitializers is a private map of named controller groups (you can start more than one in an init func)</span>
<span class="token comment">// paired to their initFunc.  This allows for structured downstream composition and subdivision.</span>
<span class="token keyword">func</span> <span class="token function">newControllerInitializers</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token keyword">map</span><span class="token punctuation">[</span><span class="token builtin">string</span><span class="token punctuation">]</span>initFunc <span class="token punctuation">{</span>
    controllers <span class="token operator">:=</span> <span class="token keyword">map</span><span class="token punctuation">[</span><span class="token builtin">string</span><span class="token punctuation">]</span>initFunc<span class="token punctuation">{</span><span class="token punctuation">}</span>
    controllers<span class="token punctuation">[</span><span class="token string">&quot;cloud-node&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> startCloudNodeController
    controllers<span class="token punctuation">[</span><span class="token string">&quot;cloud-node-lifecycle&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> startCloudNodeLifecycleController
    controllers<span class="token punctuation">[</span><span class="token string">&quot;service&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> startServiceController
    controllers<span class="token punctuation">[</span><span class="token string">&quot;route&quot;</span><span class="token punctuation">]</span> <span class="token operator">=</span> startRouteController
    <span class="token keyword">return</span> controllers
<span class="token punctuation">}</span>

<span class="token keyword">func</span> <span class="token function">startCloudNodeController</span><span class="token punctuation">(</span>ctx <span class="token operator">*</span>cloudcontrollerconfig<span class="token punctuation">.</span>CompletedConfig<span class="token punctuation">,</span> cloud cloudprovider<span class="token punctuation">.</span>Interface<span class="token punctuation">,</span> stopCh <span class="token operator">&lt;-</span><span class="token keyword">chan</span> <span class="token keyword">struct</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token punctuation">(</span>http<span class="token punctuation">.</span>Handler<span class="token punctuation">,</span> <span class="token builtin">bool</span><span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token comment">// Start the CloudNodeController</span>
    nodeController<span class="token punctuation">,</span> err <span class="token operator">:=</span> cloudcontrollers<span class="token punctuation">.</span><span class="token function">NewCloudNodeController</span><span class="token punctuation">(</span>
        ctx<span class="token punctuation">.</span>SharedInformers<span class="token punctuation">.</span><span class="token function">Core</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">V1</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">Nodes</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
        <span class="token comment">// cloud node controller uses existing cluster role from node-controller</span>
        ctx<span class="token punctuation">.</span>ClientBuilder<span class="token punctuation">.</span><span class="token function">ClientOrDie</span><span class="token punctuation">(</span><span class="token string">&quot;node-controller&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
        cloud<span class="token punctuation">,</span>
        ctx<span class="token punctuation">.</span>ComponentConfig<span class="token punctuation">.</span>NodeStatusUpdateFrequency<span class="token punctuation">.</span>Duration<span class="token punctuation">)</span>
    <span class="token operator">...</span>
    <span class="token keyword">go</span> nodeController<span class="token punctuation">.</span><span class="token function">Run</span><span class="token punctuation">(</span>stopCh<span class="token punctuation">)</span>
    <span class="token keyword">return</span> <span class="token boolean">nil</span><span class="token punctuation">,</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token boolean">nil</span>
<span class="token punctuation">}</span>

<span class="token keyword">func</span> <span class="token function">startCloudNodeLifecycleController</span><span class="token punctuation">(</span>ctx <span class="token operator">*</span>cloudcontrollerconfig<span class="token punctuation">.</span>CompletedConfig<span class="token punctuation">,</span> cloud cloudprovider<span class="token punctuation">.</span>Interface<span class="token punctuation">,</span> stopCh <span class="token operator">&lt;-</span><span class="token keyword">chan</span> <span class="token keyword">struct</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token punctuation">(</span>http<span class="token punctuation">.</span>Handler<span class="token punctuation">,</span> <span class="token builtin">bool</span><span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token comment">// Start the cloudNodeLifecycleController</span>
    cloudNodeLifecycleController<span class="token punctuation">,</span> err <span class="token operator">:=</span> cloudcontrollers<span class="token punctuation">.</span><span class="token function">NewCloudNodeLifecycleController</span><span class="token punctuation">(</span>
        ctx<span class="token punctuation">.</span>SharedInformers<span class="token punctuation">.</span><span class="token function">Core</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">V1</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">Nodes</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
        <span class="token comment">// cloud node lifecycle controller uses existing cluster role from node-controller</span>
        ctx<span class="token punctuation">.</span>ClientBuilder<span class="token punctuation">.</span><span class="token function">ClientOrDie</span><span class="token punctuation">(</span><span class="token string">&quot;node-controller&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
        cloud<span class="token punctuation">,</span>
        ctx<span class="token punctuation">.</span>ComponentConfig<span class="token punctuation">.</span>KubeCloudShared<span class="token punctuation">.</span>NodeMonitorPeriod<span class="token punctuation">.</span>Duration<span class="token punctuation">,</span>
    <span class="token punctuation">)</span>
    <span class="token operator">...</span><span class="token punctuation">.</span>
    <span class="token keyword">go</span> cloudNodeLifecycleController<span class="token punctuation">.</span><span class="token function">Run</span><span class="token punctuation">(</span>stopCh<span class="token punctuation">)</span>
    <span class="token keyword">return</span> <span class="token boolean">nil</span><span class="token punctuation">,</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token boolean">nil</span>
<span class="token punctuation">}</span>

<span class="token keyword">func</span> <span class="token function">startServiceController</span><span class="token punctuation">(</span>ctx <span class="token operator">*</span>cloudcontrollerconfig<span class="token punctuation">.</span>CompletedConfig<span class="token punctuation">,</span> cloud cloudprovider<span class="token punctuation">.</span>Interface<span class="token punctuation">,</span> stopCh <span class="token operator">&lt;-</span><span class="token keyword">chan</span> <span class="token keyword">struct</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token punctuation">(</span>http<span class="token punctuation">.</span>Handler<span class="token punctuation">,</span> <span class="token builtin">bool</span><span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token comment">// Start the service controller</span>
    serviceController<span class="token punctuation">,</span> err <span class="token operator">:=</span> servicecontroller<span class="token punctuation">.</span><span class="token function">New</span><span class="token punctuation">(</span>
        cloud<span class="token punctuation">,</span>
        ctx<span class="token punctuation">.</span>ClientBuilder<span class="token punctuation">.</span><span class="token function">ClientOrDie</span><span class="token punctuation">(</span><span class="token string">&quot;service-controller&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
        ctx<span class="token punctuation">.</span>SharedInformers<span class="token punctuation">.</span><span class="token function">Core</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">V1</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">Services</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
        ctx<span class="token punctuation">.</span>SharedInformers<span class="token punctuation">.</span><span class="token function">Core</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">V1</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">Nodes</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
        ctx<span class="token punctuation">.</span>ComponentConfig<span class="token punctuation">.</span>KubeCloudShared<span class="token punctuation">.</span>ClusterName<span class="token punctuation">,</span>
    <span class="token punctuation">)</span>
    <span class="token operator">...</span><span class="token punctuation">.</span>
    <span class="token keyword">go</span> serviceController<span class="token punctuation">.</span><span class="token function">Run</span><span class="token punctuation">(</span>stopCh<span class="token punctuation">,</span> <span class="token function">int</span><span class="token punctuation">(</span>ctx<span class="token punctuation">.</span>ComponentConfig<span class="token punctuation">.</span>ServiceController<span class="token punctuation">.</span>ConcurrentServiceSyncs<span class="token punctuation">)</span><span class="token punctuation">)</span>
    <span class="token keyword">return</span> <span class="token boolean">nil</span><span class="token punctuation">,</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token boolean">nil</span>
<span class="token punctuation">}</span>

<span class="token keyword">func</span> <span class="token function">startRouteController</span><span class="token punctuation">(</span>ctx <span class="token operator">*</span>cloudcontrollerconfig<span class="token punctuation">.</span>CompletedConfig<span class="token punctuation">,</span> cloud cloudprovider<span class="token punctuation">.</span>Interface<span class="token punctuation">,</span> stopCh <span class="token operator">&lt;-</span><span class="token keyword">chan</span> <span class="token keyword">struct</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token punctuation">(</span>http<span class="token punctuation">.</span>Handler<span class="token punctuation">,</span> <span class="token builtin">bool</span><span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token comment">// If CIDRs should be allocated for pods and set on the CloudProvider, then start the route controller</span>
    <span class="token comment">// &#x6B64;&#x5904;&#x7684;routes&#x5C31;&#x662F;&#x901A;&#x8FC7;&#x4E91;&#x670D;&#x52A1;&#x5546;sdk&#x6784;&#x5EFA;&#x51FA;&#x6765;&#x7684;route client</span>
    routes<span class="token punctuation">,</span> ok <span class="token operator">:=</span> cloud<span class="token punctuation">.</span><span class="token function">Routes</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
    <span class="token keyword">if</span> <span class="token operator">!</span>ok <span class="token punctuation">{</span>
        klog<span class="token punctuation">.</span><span class="token function">Warning</span><span class="token punctuation">(</span><span class="token string">&quot;configure-cloud-routes is set, but cloud provider does not support routes. Will not configure cloud provider routes.&quot;</span><span class="token punctuation">)</span>
        <span class="token keyword">return</span> <span class="token boolean">nil</span><span class="token punctuation">,</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token boolean">nil</span>
    <span class="token punctuation">}</span>    

<span class="token operator">...</span>
    routeController <span class="token operator">:=</span> routecontroller<span class="token punctuation">.</span><span class="token function">New</span><span class="token punctuation">(</span>
        routes<span class="token punctuation">,</span>
        ctx<span class="token punctuation">.</span>ClientBuilder<span class="token punctuation">.</span><span class="token function">ClientOrDie</span><span class="token punctuation">(</span><span class="token string">&quot;route-controller&quot;</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
        ctx<span class="token punctuation">.</span>SharedInformers<span class="token punctuation">.</span><span class="token function">Core</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">V1</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">Nodes</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
        ctx<span class="token punctuation">.</span>ComponentConfig<span class="token punctuation">.</span>KubeCloudShared<span class="token punctuation">.</span>ClusterName<span class="token punctuation">,</span>
        clusterCIDRs<span class="token punctuation">,</span>
    <span class="token punctuation">)</span>
    <span class="token keyword">go</span> routeController<span class="token punctuation">.</span><span class="token function">Run</span><span class="token punctuation">(</span>stopCh<span class="token punctuation">,</span> ctx<span class="token punctuation">.</span>ComponentConfig<span class="token punctuation">.</span>KubeCloudShared<span class="token punctuation">.</span>RouteReconciliationPeriod<span class="token punctuation">.</span>Duration<span class="token punctuation">)</span>
    <span class="token keyword">return</span> <span class="token boolean">nil</span><span class="token punctuation">,</span> <span class="token boolean">true</span><span class="token punctuation">,</span> <span class="token boolean">nil</span>
<span class="token punctuation">}</span>
</code></pre>
<ul>
<li>4.service type&#x3000;&#x53D8;&#x5316;&#x540E;&#x8C03;&#x7528; cloudProvider LoadBalancer&#x76F8;&#x5173;&#x63A5;&#x53E3;&#x5BF9;LB &#x6267;&#x884C;CRUD</li>
</ul>
<p>// create or update LB</p>
<pre class="language-"><code class="lang-go"><span class="token comment">// EnsureLoadBalancer creates a new load balancer &apos;name&apos;, or updates the existing one.</span>
<span class="token keyword">func</span> <span class="token punctuation">(</span>lbaas <span class="token operator">*</span>LbaasV2<span class="token punctuation">)</span> <span class="token function">EnsureLoadBalancer</span><span class="token punctuation">(</span>ctx context<span class="token punctuation">.</span>Context<span class="token punctuation">,</span> clusterName <span class="token builtin">string</span><span class="token punctuation">,</span> apiService <span class="token operator">*</span>v1<span class="token punctuation">.</span>Service<span class="token punctuation">,</span> nodes <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token operator">*</span>v1<span class="token punctuation">.</span>Node<span class="token punctuation">)</span> <span class="token punctuation">(</span><span class="token operator">*</span>v1<span class="token punctuation">.</span>LoadBalancerStatus<span class="token punctuation">,</span> <span class="token builtin">error</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token operator">...</span>
    <span class="token comment">// &#x83B7;&#x53D6;service port</span>
    ports <span class="token operator">:=</span> apiService<span class="token punctuation">.</span>Spec<span class="token punctuation">.</span>Ports
    <span class="token keyword">if</span> <span class="token function">len</span><span class="token punctuation">(</span>ports<span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">0</span> <span class="token punctuation">{</span>
        <span class="token keyword">return</span> <span class="token boolean">nil</span><span class="token punctuation">,</span> fmt<span class="token punctuation">.</span><span class="token function">Errorf</span><span class="token punctuation">(</span><span class="token string">&quot;no ports provided to openstack load balancer&quot;</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span>

    affinity <span class="token operator">:=</span> apiService<span class="token punctuation">.</span>Spec<span class="token punctuation">.</span>SessionAffinity

    <span class="token comment">//&#x82E5;&#x6307;&#x5B9A;&#x4E86;elb_id&#xFF0C;&#x5219;&#x4E0D;&#x521B;&#x5EFA;elb</span>
    elbId <span class="token operator">:=</span> <span class="token function">getStringFromServiceAnnotation</span><span class="token punctuation">(</span>apiService<span class="token punctuation">,</span> ServiceAnnotationLoadBalancerInstanceID<span class="token punctuation">,</span> <span class="token string">&quot;&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">if</span> elbId <span class="token operator">!=</span> <span class="token string">&quot;&quot;</span> <span class="token punctuation">{</span>
        <span class="token comment">// &#x6839;&#x636E; loadbalancer id &#x83B7;&#x53D6; loadbalancer</span>
        isCreateElb <span class="token operator">=</span> <span class="token boolean">false</span>
        loadbalancer<span class="token punctuation">,</span> err <span class="token operator">=</span> <span class="token function">getLoadbalancerByID</span><span class="token punctuation">(</span>lbaas<span class="token punctuation">.</span>lb<span class="token punctuation">,</span> elbId<span class="token punctuation">)</span>
         <span class="token operator">...</span><span class="token punctuation">.</span>
        <span class="token comment">// &#x6839;&#x636E;service uuid &#x83B7;&#x53D6; loadbalancer &#x7684;&#x6807;&#x51C6;&#x547D;&#x540D;&#x683C;&#x5F0F;</span>
        name <span class="token operator">:=</span> lbaas<span class="token punctuation">.</span><span class="token function">GetLoadBalancerName</span><span class="token punctuation">(</span>ctx<span class="token punctuation">,</span> clusterName<span class="token punctuation">,</span> apiService<span class="token punctuation">)</span>
        <span class="token comment">// &#x9700;&#x8981;&#x66F4;&#x65B0;lb&#x7684;name&#xFF0C;&#x5426;&#x5219;&#x65E0;&#x6CD5;&#x5220;&#x9664;lb</span>
        err <span class="token operator">=</span> lbaas<span class="token punctuation">.</span><span class="token function">updateLoadBalancerName</span><span class="token punctuation">(</span>apiService<span class="token punctuation">,</span> name<span class="token punctuation">,</span> elbId<span class="token punctuation">)</span>
            <span class="token operator">...</span>
    <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
        <span class="token comment">//&#x521B;&#x5EFA;elb</span>
        lbaas<span class="token punctuation">.</span>opts<span class="token punctuation">.</span>SubnetID <span class="token operator">=</span> <span class="token function">getStringFromServiceAnnotation</span><span class="token punctuation">(</span>apiService<span class="token punctuation">,</span> ServiceAnnotationLoadBalancerSubnetID<span class="token punctuation">,</span> lbaas<span class="token punctuation">.</span>opts<span class="token punctuation">.</span>SubnetID<span class="token punctuation">)</span>
        <span class="token keyword">if</span> <span class="token function">len</span><span class="token punctuation">(</span>lbaas<span class="token punctuation">.</span>opts<span class="token punctuation">.</span>SubnetID<span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">0</span> <span class="token punctuation">{</span>
            subnetID<span class="token punctuation">,</span> err <span class="token operator">:=</span> <span class="token function">getSubnetIDForLB</span><span class="token punctuation">(</span>lbaas<span class="token punctuation">.</span>compute<span class="token punctuation">,</span> <span class="token operator">*</span>nodes<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span>
            lbaas<span class="token punctuation">.</span>opts<span class="token punctuation">.</span>SubnetID <span class="token operator">=</span> subnetID
        <span class="token punctuation">}</span>
        name <span class="token operator">:=</span> lbaas<span class="token punctuation">.</span><span class="token function">GetLoadBalancerName</span><span class="token punctuation">(</span>ctx<span class="token punctuation">,</span> clusterName<span class="token punctuation">,</span> apiService<span class="token punctuation">)</span>
        <span class="token comment">//&#x3000;&#x521B;&#x5EFA;lb</span>
        loadbalancer<span class="token punctuation">,</span> err <span class="token operator">=</span> lbaas<span class="token punctuation">.</span><span class="token function">createLoadBalancer</span><span class="token punctuation">(</span>apiService<span class="token punctuation">,</span> name<span class="token punctuation">,</span> internalAnnotation<span class="token punctuation">)</span>
    <span class="token punctuation">}</span>

    <span class="token comment">// &#x83B7;&#x53D6;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#x7B97;&#x6CD5;</span>
    lbMethod <span class="token operator">:=</span> <span class="token function">getLBMethod</span><span class="token punctuation">(</span>apiService<span class="token punctuation">)</span>


    <span class="token comment">//&#x3000;&#x4E3A;lb&#x3000;&#x521B;&#x5EFA;&#x76D1;&#x542C;&#x5668;&#xFF0C;&#x6709;&#x51E0;&#x4E2A;&#x7AEF;&#x53E3;&#xFF0C;&#x5C31;&#x521B;&#x5EFA;&#x51E0;&#x4E2A;</span>
    <span class="token keyword">for</span> portIndex<span class="token punctuation">,</span> port <span class="token operator">:=</span> <span class="token keyword">range</span> ports <span class="token punctuation">{</span>

    <span class="token punctuation">}</span>

    <span class="token comment">// &#x521B;&#x5EFA;eip</span>
    <span class="token keyword">if</span> floatIP <span class="token operator">==</span> <span class="token boolean">nil</span> <span class="token operator">&amp;&amp;</span> floatingPool <span class="token operator">!=</span> <span class="token string">&quot;&quot;</span> <span class="token operator">&amp;&amp;</span> <span class="token operator">!</span>internalAnnotation <span class="token punctuation">{</span>
        <span class="token operator">...</span><span class="token punctuation">.</span>
        <span class="token punctuation">}</span>
    status <span class="token operator">:=</span> <span class="token operator">&amp;</span>v1<span class="token punctuation">.</span>LoadBalancerStatus<span class="token punctuation">{</span><span class="token punctuation">}</span>

    <span class="token keyword">return</span> status<span class="token punctuation">,</span> <span class="token boolean">nil</span>
<span class="token punctuation">}</span>
</code></pre>
<h3 id="&#x90E8;&#x7F72;"><a name="&#x90E8;&#x7F72;" class="anchor-navigation-ex-anchor" href="#&#x90E8;&#x7F72;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x90E8;&#x7F72;</h3>
<p>&#x4EE5;&#x4E0B;&#x90E8;&#x7F72;&#x65B9;&#x5F0F;&#x9002;&#x7528;&#x4E8E;&#x57FA;&#x4E8E;openstack&#x6539;&#x9020;&#x540E;&#x7684;&#x534E;&#x4E3A;ccm</p>
<h4 id="&#x90E8;&#x7F72;&#x524D;&#x5FC5;&#x987B;&#x5148;&#x5728;kubelet&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x52A0;&#x5165;&#x5982;&#x4E0B;&#x53C2;&#x6570;"><a name="&#x90E8;&#x7F72;&#x524D;&#x5FC5;&#x987B;&#x5148;&#x5728;kubelet&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x52A0;&#x5165;&#x5982;&#x4E0B;&#x53C2;&#x6570;" class="anchor-navigation-ex-anchor" href="#&#x90E8;&#x7F72;&#x524D;&#x5FC5;&#x987B;&#x5148;&#x5728;kubelet&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x52A0;&#x5165;&#x5982;&#x4E0B;&#x53C2;&#x6570;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x90E8;&#x7F72;&#x524D;&#x5FC5;&#x987B;&#x5148;&#x5728;kubelet&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x52A0;&#x5165;&#x5982;&#x4E0B;&#x53C2;&#x6570;</h4>
<p>--hostname-override=${INSTANCE_ID}
--provider-id=${INSTANCE_ID}</p>
<h4 id="&#x96C6;&#x7FA4;&#x5916;&#x90E8;&#x7F72;"><a name="&#x96C6;&#x7FA4;&#x5916;&#x90E8;&#x7F72;" class="anchor-navigation-ex-anchor" href="#&#x96C6;&#x7FA4;&#x5916;&#x90E8;&#x7F72;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x96C6;&#x7FA4;&#x5916;&#x90E8;&#x7F72;</h4>
<pre class="language-"><code class="lang-bash"><span class="token builtin class-name">export</span> <span class="token assign-left variable">IDENTITY_ENDPOINT</span><span class="token operator">=</span>https://iam.cn-east-3.myhuaweicloud.com/v3
<span class="token builtin class-name">export</span> <span class="token assign-left variable">PROJECT_ID</span><span class="token operator">=</span><span class="token punctuation">..</span>.
<span class="token builtin class-name">export</span> <span class="token assign-left variable">DOMAIN_ID</span><span class="token operator">=</span><span class="token punctuation">..</span>.
<span class="token builtin class-name">export</span> <span class="token assign-left variable">ACCESS_KEY_ID</span><span class="token operator">=</span> <span class="token punctuation">..</span>.
<span class="token builtin class-name">export</span> <span class="token assign-left variable">ACCESS_KEY_SECRET</span><span class="token operator">=</span> <span class="token punctuation">..</span><span class="token punctuation">..</span>
<span class="token builtin class-name">export</span> <span class="token assign-left variable">ROUTER_ID</span><span class="token operator">=</span> <span class="token punctuation">..</span>.
<span class="token builtin class-name">export</span> <span class="token assign-left variable">REGION</span><span class="token operator">=</span> <span class="token punctuation">..</span>.
go run ./cmd/cloud-controller-manager.go --kubeconfig<span class="token operator">=</span>./kube.config -v <span class="token number">4</span>
</code></pre>
<h4 id="&#x96C6;&#x7FA4;&#x5185;&#x90E8;&#x7F72;"><a name="&#x96C6;&#x7FA4;&#x5185;&#x90E8;&#x7F72;" class="anchor-navigation-ex-anchor" href="#&#x96C6;&#x7FA4;&#x5185;&#x90E8;&#x7F72;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x96C6;&#x7FA4;&#x5185;&#x90E8;&#x7F72;</h4>
<p>RBAC, &#x8FD9;&#x91CC;&#x4E3A;&#x4E86;&#x65B9;&#x4FBF;&#x597D;&#x770B;&#x76F4;&#x63A5;&#x7528;&#x4E86;&#x8D85;&#x7EA7;&#x6743;&#x9650;</p>
<pre class="language-"><code>---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: cloud-controller-manager
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: cloud-controller-manager
  namespace: kube-system
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
  - kind: ServiceAccount
    name: cloud-controller-manager
    namespace: kube-system
</code></pre><p>DaemonSet</p>
<pre class="language-"><code>apiVersion: apps/v1
kind: DaemonSet
metadata:
  labels:
    k8s-app: cloud-controller-manager
  name: cloud-controller-manager
  namespace: kube-system
spec:
  selector:
    matchLabels:
      k8s-app: cloud-controller-manager
  template:
    metadata:
      labels:
        k8s-app: cloud-controller-manager
    spec:
      serviceAccountName: cloud-controller-manager
      containers:
        - name: cloud-controller-manager
          image: ...-huawei-ccm
          imagePullPolicy: Always
          command:
            - /cloud-controller-manager
          env:
            - name: IDENTITY_ENDPOINT
              value: &quot;https://iam.cn-east-3.myhuaweicloud.com/v3&quot;
            - name: PROJECT_ID
              value: ...
            - name: DOMAIN_ID
              value: ...
            - name: ACCESS_KEY_ID
              value: ...
            - name: ACCESS_KEY_SECRET
              value: ...
            - name: ROUTER_ID
              value: ...
            - name: REGION
              value: ...
            - name: SUBNET_ID
              value: ...
      tolerations:
        - effect: NoSchedule
          operator: Exists
          key: node-role.kubernetes.io/master
        - effect: NoSchedule
          operator: Exists
          key: node.cloudprovider.kubernetes.io/uninitialized
        - key: node-role.kubernetes.io/master
          effect: NoSchedule
      nodeSelector:
        node-role.kubernetes.io/master: &quot;&quot;
      hostNetwork: true
</code></pre><p>&#x53C2;&#x8003;&#x6587;&#x732E;:</p>
<ol>
<li><a href="https://mp.weixin.qq.com/s/a_540yJ1EGVroJ9TpvYtPw" target="_blank">https://mp.weixin.qq.com/s/a_540yJ1EGVroJ9TpvYtPw</a></li>
</ol>
<p>&#x4F5C;&#x8005;&#x7B80;&#x4ECB;:
&#x8521;&#x9521;&#x751F;&#xFF0C;&#x3000;&#x676D;&#x5DDE;&#x6717;&#x6F88;&#x79D1;&#x6280;&#x6709;&#x9650;&#x516C;&#x53F8;k8s&#x5DE5;&#x7A0B;&#x5E08;</p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; caixisheng 2017 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2021-04-10 01:40:56
</span></footer> <link rel="stylesheet" type="text/css" href="https://storage.googleapis.com/app.klipse.tech/css/codemirror.css"> <script>     window.klipse_settings = {         selector: ".language-klipse, .lang-eval-clojure",         selector_eval_js: ".lang-eval-js",         selector_eval_python_client: ".lang-eval-python",         selector_eval_php: ".lang-eval-php",         selector_eval_scheme: ".lang-eval-scheme",         selector_eval_ruby: ".lang-eval-ruby",         selector_reagent: ".lang-reagent",        selector_google_charts: ".lang-google-chart",        selector_es2017: ".lang-eval-es2017",        selector_jsx: ".lang-eval-jsx",        selector_transpile_jsx: ".lang-transpile-jsx",        selector_render_jsx: ".lang-render-jsx",        selector_react: ".lang-react",        selector_eval_markdown: ".lang-render-markdown",        selector_eval_lambdaway: ".lang-render-lambdaway",        selector_eval_cpp: ".lang-eval-cpp",        selector_eval_html: ".lang-render-html",        selector_sql: ".lang-eval-sql",        selector_brainfuck: "lang-eval-brainfuck",        selector_js: ".lang-transpile-cljs"    }; </script> <script src="https://storage.googleapis.com/app.klipse.tech/plugin/js/klipse_plugin.js"></script>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="admission access.html" class="navigation navigation-prev " aria-label="Previous page: Admission Access">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="client-go.html" class="navigation navigation-next " aria-label="Next page: Client Go">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Ccm","level":"1.9.8","depth":2,"next":{"title":"Client Go","level":"1.9.9","depth":2,"path":"blog/kubernetes/client-go.md","ref":"blog/kubernetes/client-go.md","articles":[]},"previous":{"title":"Admission Access","level":"1.9.7","depth":2,"path":"blog/kubernetes/admission access.md","ref":"blog/kubernetes/admission access.md","articles":[]},"dir":"ltr"},"config":{"plugins":["summary","expandable-chapters","toggle-chapters","theme-comscore","-lunr","-search","-highlight","-livereload","search-plus@^0.0.11","simple-page-toc@^0.1.1","github@^2.0.0","github-buttons@2.1.0","edit-link@^2.0.2","disqus@^0.1.0","prism@^2.1.0","prism-themes@^0.0.2","advanced-emoji@^0.2.1","anchors@^0.7.1","include-codeblock@^3.0.2","emphasize@^1.1.0","katex@^1.1.3","splitter@^0.0.8","mermaid-gb3@2.1.0","tbfed-pagefooter@^0.0.1","expandable-chapters-small@^0.1.7","sectionx@^3.1.0","donate@^1.0.2","local-video@^1.0.1","anchor-navigation-ex@0.1.8","favicon@^0.0.2","3-ba@^0.9.0","terminal@^0.3.2","alerts@^0.2.0","include-csv@^0.1.0","puml@^1.0.1","musicxml@^1.0.2","klipse@^1.2.0","versions-select@^0.1.1","-sharing","sharing-plus@^0.0.2","graph@^0.1.0","chart@^0.2.0"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright © caixisheng 2017","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prism-themes/themes/prism-base16-ateliersulphurpool.light.css"]},"include-csv":{},"disqus":{"useIdentifier":false,"shortName":"gitbookuse"},"emphasize":{},"github":{"url":"https://github.com/xishengcai/xisheng.blog"},"puml":{},"simple-page-toc":{"maxDepth":3,"skipFirstH1":true},"summary":{},"splitter":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"versions-select":{"type":"branches"},"graph":{},"donate":{"alipay":"https://cai-hello-1253732611.cos.ap-shanghai.myqcloud.com/share/zhifubao-pay.jpg","alipayText":"支付宝打赏","button":"赏","title":"","wechat":"https://cai-hello-1253732611.cos.ap-shanghai.myqcloud.com/share/weixin-pay.jpg","wechatText":"微信打赏"},"katex":{},"fontsettings":{"theme":"white","family":"sans","size":2},"musicxml":{},"sectionx":{"tag":"b"},"mermaid-gb3":{},"anchor-navigation-ex":{"isRewritePageTitle":false,"tocLevel1Icon":"fa fa-hand-o-right","tocLevel2Icon":"fa fa-hand-o-right","tocLevel3Icon":"fa fa-hand-o-right"},"favicon":{"shortcut":"favicon.ico","bookmark":"favicon.ico"},"theme-comscore":{},"prism-themes":{},"alerts":{},"github-buttons":{"repo":"xishengcai/xisheng.blog","types":["star"],"size":"small"},"3-ba":{"configuration":"auto","token":"ff100361cdce95dd4c8fb96b4009f7bc"},"expandable-chapters-small":{},"local-video":{},"klipse":{"myConfigKey":"it's the default value"},"advanced-emoji":{"embedEmojis":false},"include-codeblock":{"check":false,"edit":true,"fixlang":false,"lang":"","template":"ace","theme":"chrome","unindent":true},"sharing":{"qq":false,"all":["facebook","google","twitter","weibo","instapaper","linkedin","pocket","stumbleupon","qq","qzone"],"douban":false,"facebook":false,"weibo":true,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":true,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":true},"terminal":{"copyButtons":true,"fade":false,"style":"flat"},"edit-link":{"label":"Edit This Page","base":"https://github.com/xishengcai/xisheng.blog/edit/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"anchors":{},"chart":{"type":"c3"},"toggle-chapters":{},"expandable-chapters":{},"search-plus":{}},"theme":"default","author":"xishengcai","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"这是程序员吗","language":"zh-hans","output.name":"site","links":{"sidebar":{"Home":"https://xisheng.vip"}},"gitbook":"3.2.3","description":"这是程序员吗"},"file":{"path":"blog/kubernetes/ccm.md","mtime":"2021-04-09T17:40:56.776Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-06-23T07:51:54.455Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/URI.js/1.16.1/URI.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-disqus/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-mermaid-gb3/book/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sectionx/sectionx.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-local-video/video.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-3-ba/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-terminal/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-alerts/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-musicxml/osmd.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-musicxml/musicxml.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-musicxml/promise.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-versions-select/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-theme-comscore/test.js"></script>
        
    

    <script src="../../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.min.js"></script>

    </body>
</html>

